Methods, devices, electronic equipment, and software products for detecting transaction risks

By performing missing data imputation, noise removal, and feature enhancement on merchant transaction data, and training with a deep residual network model, the problem of low detection accuracy in traditional transaction risk detection methods is solved, achieving higher-precision risk assessment.

CN123118243APending Publication Date: 2026-11-17INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611405841.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-10
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Traditional transaction risk detection methods rely on linear feature extraction, which makes it difficult to fully capture nonlinear relationships and potential patterns in the data, resulting in low detection accuracy.

Method used

By collecting merchant transaction data, filling in missing data, removing noise features using holiday and industry periodic time windows, extracting abnormal time series features and residual features, generating enhanced time series features, and inputting them into a credit risk detection model based on deep residual networks for training.

Benefits of technology

It improves the accuracy of transaction risk assessment and the model's ability to process complex data, thereby enhancing the precision of merchant transaction risk detection and the robustness of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123118243A_ABST
    Figure CN123118243A_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, electronic device, and program product for detecting transaction risk, relating to the field of artificial intelligence. The method includes: collecting transaction data from a target merchant and performing data imputation on missing data to obtain cleaned raw data; removing noise features from the raw data based on a fluctuation time window and extracting abnormal time-series features; extracting residual features from the raw data based on the business scenario and fluctuation time window, and combining the raw data to generate enhanced time-series features; inputting the target merchant's transaction amount, abnormal time-series features, and enhanced time-series features into a credit risk detection model to obtain the detection results output by the credit risk detection model. This application solves the problem that traditional transaction risk detection methods in related technologies typically rely on linear feature extraction, which is difficult to fully capture nonlinear relationships and potential patterns in the data, leading to low detection accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence, and more specifically, to a method, apparatus, electronic device, and program product for detecting transaction risks. Background Technology

[0002] While traditional merchant loan risk detection methods can meet business needs to some extent, their limitations become increasingly apparent when faced with complex and ever-changing merchant loan scenarios. Traditional methods typically rely on manually designed feature engineering, extracting and combining features through linear models or non-deep neural networks. This approach struggles to fully capture the non-linear relationships and potential patterns within the data, resulting in low predictive accuracy. Merchant operational data is often highly heterogeneous and complex, with intricate interactions between these pieces of information; simple linear extraction cannot effectively uncover the deep correlations.

[0003] Secondly, traditional methods are limited in their ability to process high-dimensional, heterogeneous data, making it difficult to effectively extract deeper information from the data. Existing methods have low computational efficiency when dealing with large-scale data and poor robustness to noise and outliers. For example, merchants' transaction records often contain various abnormal data such as holiday fluctuations. Traditional methods often use uniform smoothing or elimination strategies, which can easily filter out valuable risks or business characteristics, further limiting their effectiveness in actual business applications.

[0004] Traditional transaction risk detection methods in related technologies typically rely on linear feature extraction, which makes it difficult to fully capture nonlinear relationships and potential patterns in the data, resulting in low detection accuracy. Currently, no effective solution has been proposed. Summary of the Invention

[0005] The main objective of this application is to provide a method, device, electronic device, and program product for detecting transaction risks, in order to solve the problem that traditional transaction risk detection methods in related technologies usually rely on linear feature extraction, which makes it difficult to fully capture nonlinear relationships and potential patterns in the data, resulting in low detection accuracy.

[0006] To achieve the above objectives, according to one aspect of this application, a method for detecting transaction risk is provided. The method includes: collecting transaction data from a target merchant with authorization, and performing data imputation on missing data in the transaction data to obtain cleaned raw data; removing noise features from the raw data based on a fluctuation time window and extracting abnormal time-series features, wherein the fluctuation time window includes at least: a holiday time window and an industry periodic time window; extracting residual features from the raw data based on the business scenario and the fluctuation time window, and generating enhanced time-series features by combining the raw data; inputting the target merchant's transaction amount, abnormal time-series features, and enhanced time-series features into a credit risk detection model, and obtaining the detection results output by the credit risk detection model, wherein the credit risk detection model is a model trained based on a deep residual network model.

[0007] Furthermore, before inputting the target merchant's transaction amount, abnormal time-series features, and enhanced time-series features into the credit risk detection model, the above method also includes: processing historical transaction data to obtain historical abnormal time-series features and historical enhanced time-series features, and constructing a training set by combining the transaction amount of each transaction in the historical transaction data; extracting multiple candidate sample sets from the training set based on multiple candidate batches, training the deep residual network model using multiple candidate sample sets, evaluating the performance score of each candidate sample set based on evaluation metrics, and determining the target batch from multiple candidate batches based on the performance score; training the deep residual network model based on the target batch and the training set, determining the loss function value based on the model's output results and the transaction labels of historical merchants during the training process, and selecting the credit risk detection model from the model training results based on the changing trend of the loss function value.

[0008] Furthermore, multiple candidate sample sets are used to train the deep residual network model, and the performance score of each candidate sample set is evaluated based on evaluation metrics, including: inputting each candidate sample set into the deep residual network model to obtain the output result of each candidate sample set; determining the root mean square error based on the output result of each candidate sample set and the transaction label to obtain the first prediction bias; determining the mean absolute error based on the output result of each candidate sample set and the transaction label to obtain the second prediction bias; determining the coefficient of determination based on the statistical characteristics of the output results of multiple candidate sample sets to obtain the third prediction bias; and determining the performance score of each candidate sample set based on the first prediction bias, the second prediction bias, and the third prediction bias.

[0009] Furthermore, residual features are extracted from the original data based on business scenarios and fluctuation time windows, and enhanced time-series features are generated by combining the original data. This includes: mapping the original data to industry periodic time windows, normalizing the transaction data in each time window, and concatenating them to obtain periodic features. The industry periodic time window includes at least a first time window and a second time window, with the transaction frequency in the first time window being greater than that in the second time window; obtaining the first statistical features of merchants in the target industry within the industry periodic time window, and determining the industry residual by combining them with the original data; obtaining the second statistical features of surrounding merchants within the industry periodic time window, and determining the business district residual by combining them with the original data; and concatenating the original data, periodic features, industry residual, and business district residual to generate enhanced time-series features.

[0010] Furthermore, noise features are removed from the original data based on the fluctuation time window, and abnormal time-series features are extracted. This includes: sorting the transaction data in the original data according to time order to obtain transaction time-series data; identifying noisy data in the transaction time-series data based on a preset threshold, and replacing the noisy data with the statistical features of the context time-series data of the noisy data; identifying whether there is a downward trend in the transaction features in the transaction time-series data based on the preset time window, and determining the trading features of the preset time window as decay risk features if a downward trend exists; extracting target time-series data from the transaction time-series data based on the fluctuation time window, and filtering compliant time-series data based on the context data of the target time-series data; and determining abnormal time-series features based on compliant time-series data and decay risk features.

[0011] Furthermore, data imputation is performed on the missing data in the transaction data to obtain the cleaned original data. This includes: traversing the numerical and categorical data in the transaction data to determine the missing proportions of the numerical and categorical data; for numerical data with a missing proportion below a preset threshold, determining the third statistical feature of the corresponding non-missing samples and imputing the missing data of the numerical data based on the third statistical feature; for numerical data with a missing proportion above a preset threshold, using an interpolation algorithm to process the historical data of the numerical data and imputing the missing data of the numerical data based on the processing result; for categorical data with a missing proportion below a preset threshold, determining the fourth statistical feature of the corresponding non-missing samples and imputing the missing data of the categorical data based on the fourth statistical feature; and for categorical data with a missing proportion above a preset threshold, imputing the missing data of the categorical data based on a new category.

[0012] Furthermore, the collection of transaction data from target merchants includes: extracting historical business flow data of target merchants from the transaction system of financial institutions, wherein historical business flow data includes: historical transaction data and historical business attribute data, and historical transaction data includes at least: historical lending data; obtaining historical credit data of target merchants from the risk control system of financial institutions, wherein historical credit data includes: credit score and historical default data; determining the target industry to which the target merchant belongs and obtaining external environmental data of the target industry; and determining the transaction data of the target merchant based on historical business flow data, historical credit data and external environmental data.

[0013] To achieve the above objectives, according to another aspect of this application, a transaction risk detection device is provided. The device includes: a collection unit, configured to collect transaction data of a target merchant with authorization, and to perform data filling operations on missing data in the transaction data to obtain cleaned raw data; a first extraction unit, configured to remove noise features from the raw data based on a fluctuation time window, and extract abnormal time-series features, wherein the fluctuation time window includes at least: a holiday time window and an industry periodic time window; a second extraction unit, configured to extract residual features from the raw data based on the business scenario and the fluctuation time window, and to generate enhanced time-series features in combination with the raw data; and a detection unit, configured to input the target merchant's transaction amount, abnormal time-series features, and enhanced time-series features into a credit risk detection model, and obtain the detection results output by the credit risk detection model, wherein the credit risk detection model is a model trained based on a deep residual network model.

[0014] Furthermore, the aforementioned apparatus further includes: a processing unit, used to process historical transaction data to obtain historical abnormal time-series features and historical enhanced time-series features before inputting the transaction amount, abnormal time-series features, and enhanced time-series features of the target merchant into the credit risk detection model, and to construct a training set by combining the transaction amount of each transaction in the historical transaction data; a first training unit, used to extract multiple candidate sample sets from the training set based on multiple candidate batches, use multiple candidate sample sets to train the deep residual network model, evaluate the performance score of each candidate sample set based on evaluation metrics, and determine the target batch from multiple candidate batches based on the performance score; and a second training unit, used to train the deep residual network model based on the target batch and the training set, determine the loss function value based on the model's output results and the transaction labels of historical merchants during the training process, and select the credit risk detection model from the model training results based on the changing trend of the loss function value.

[0015] Further, the first training unit includes: a first processing subunit, used to input each candidate sample set into the deep residual network model to obtain the output result of each candidate sample set; a first determination subunit, used to determine the root mean square error based on the output result of each candidate sample set and the transaction label to obtain a first prediction bias; a second determination subunit, used to determine the mean absolute error based on the output result of each candidate sample set and the transaction label to obtain a second prediction bias; a third determination subunit, used to determine the coefficient of determination based on the statistical characteristics of the output results of multiple candidate sample sets to obtain a third prediction bias; and a fourth determination subunit, used to determine the performance score of each candidate sample set based on the first prediction bias, the second prediction bias, and the third prediction bias.

[0016] Further, the second extraction unit includes: a second processing subunit, used to map the original data to an industry periodic time window, normalize the transaction data of each time window, and concatenate them to obtain periodic features, wherein the industry periodic time window includes at least a first time window and a second time window, and the transaction frequency of the first time window is greater than that of the second time window; a first acquisition subunit, used to acquire the first statistical features of merchants in the target industry to which the target merchant belongs within the industry periodic time window, and determine the industry residual in combination with the original data; a second acquisition subunit, used to acquire the second statistical features of the surrounding merchants of the target merchant within the industry periodic time window, and determine the business district residual in combination with the original data; and a concatenation subunit, used to concatenate the original data, periodic features, industry residual, and business district residual to generate enhanced time-series features.

[0017] Further, the first extraction unit includes: a sorting subunit, used to sort the transaction data in the original data according to time order to obtain transaction time series data; a replacement subunit, used to identify noise data in the transaction time series data according to a preset threshold, and replace the noise data based on the statistical characteristics of the context time series data of the noise data; an identification subunit, used to identify whether there is a downward trend in the transaction characteristics in the transaction time series data based on a preset time window, and if there is a downward trend, determine it as a decay risk feature based on the transaction characteristics of the preset time window; a first extraction subunit, used to extract target time series data from the transaction time series data according to the fluctuation time window, and filter compliant time series data based on the context data of the target time series data; and a fifth determination subunit, used to determine abnormal time series features based on compliant time series data and decay risk features.

[0018] Furthermore, the acquisition unit includes: a sixth determining subunit, used to traverse the numerical and categorical data in the transaction data to determine the missing proportions of the numerical data and the categorical data; a seventh determining subunit, used to determine the third statistical feature of the non-missing samples corresponding to the numerical data with a missing proportion lower than a preset threshold, and fill the missing data of the numerical data according to the third statistical feature; a first filling subunit, used to process the historical data of the numerical data with a missing proportion higher than a preset threshold using an interpolation algorithm, and fill the missing data of the numerical data according to the processing result; a second filling subunit, used to determine the fourth statistical feature of the non-missing samples corresponding to the categorical data with a missing proportion lower than a preset threshold, and fill the missing data of the categorical data according to the fourth statistical feature; and a third filling subunit, used to fill the missing data of the categorical data with a missing proportion higher than a preset threshold according to a new category.

[0019] Furthermore, the collection unit includes: a first extraction subunit, used to extract historical business flow data of the target merchant from the financial institution's transaction system, wherein the historical business flow data includes: historical transaction data and historical business attribute data, and the historical transaction data includes at least: historical lending data; a third acquisition subunit, used to acquire historical credit data of the target merchant from the financial institution's risk control system, wherein the historical credit data includes: credit score and historical default data; a third acquisition subunit, used to determine the target industry to which the target merchant belongs and acquire external environmental data of the target industry; and an eighth determination subunit, used to determine the transaction data of the target merchant based on the historical business flow data, historical credit data, and external environmental data.

[0020] To achieve the above objectives, according to one aspect of this application, a computer program product is provided, including a computer program that, when executed by a processor, implements any of the above-described methods for detecting transaction risks, and when executed by a processor, implements the steps of the transaction risk detection methods in various embodiments of this application.

[0021] To achieve the above objectives, according to one aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium including stored computer instructions, wherein, when the computer instructions are executed by a processor, the method for detecting any of the above-mentioned transaction risks is implemented.

[0022] To achieve the above objectives, according to one aspect of this application, an electronic device is provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement any of the above-described methods for detecting transaction risks.

[0023] In this embodiment, by collecting multidimensional merchant data and filling in missing values, the integrity and consistency of the data foundation are ensured. Random noise is differentially removed using holiday and industry-specific periodic time windows, and the actual operating characteristics of merchants are used as abnormal time-series features, avoiding the distortion of operating characteristics caused by traditional global smoothing. Furthermore, residuals are calculated based on business scenarios to generate enhanced time-series features, constructing a high-dimensional differentiated input feature set. This set is then input into a credit risk detection model trained on a deep residual network. The residual connection structure effectively alleviates the gradient vanishing problem in deep network training, and nonlinear feature mapping captures complex nonlinear relationships and potential patterns in merchant operating data, achieving the technical effect of improving the accuracy of transaction risk assessment. Therefore, this approach solves the problem that traditional transaction risk detection methods often rely on linear feature extraction, which struggles to fully capture nonlinear relationships and potential patterns in the data, leading to low detection accuracy. This approach improves the accuracy of merchant transaction risk detection and enhances the model's ability to process complex data. Attached Figure Description

[0024] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0025] Figure 1 This is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for detecting transaction risks, according to Embodiment 1 of this application;

[0026] Figure 2 This is a flowchart of an optional transaction risk detection method provided according to Embodiment 1 of this application;

[0027] Figure 3 This is a flowchart illustrating an optional merchant credit loan transaction risk detection method provided in Embodiment 1 of this application;

[0028] Figure 4 This is a schematic diagram of the optional credit risk detection model construction and training process provided in Embodiment 1 of this application;

[0029] Figure 5 This is a schematic diagram illustrating the specific process of input data processing and feature engineering for the optional credit risk detection model provided in Embodiment 1 of this application;

[0030] Figure 6 This is a schematic diagram of a transaction risk detection device provided according to Embodiment 2 of this application;

[0031] Figure 7This is a schematic diagram of an electronic device for detecting transaction risks according to Embodiment 3 of this application. Detailed Implementation

[0032] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0033] It should be noted that the processing method, apparatus, storage medium, and electronic device specified in this application can be used in the financial technology field to improve the accuracy of transaction risk detection, and can also be used in any field other than financial technology. The application fields of the processing method, apparatus, storage medium, and electronic device specified in this application are not limited.

[0034] It should be noted that the information collected in this application (including but not limited to user device information, user personal information, collected data, used data, generated data, processed data, etc.) and the data (including but not limited to data used for analysis, stored data, displayed data, collected information, used information, generated information, processed information, etc.) are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of the relevant data all comply with the relevant laws and standards of the relevant regions, do not violate public order and good morals, and provide corresponding operation entry points for users to choose to authorize or refuse. For example, this system has interfaces with relevant users or organizations, providing users with corresponding operation entry points for users to choose to agree to or refuse automated decision results; if the user chooses to refuse, the process proceeds to the expert decision-making process.

[0035] Example 1

[0036] According to an embodiment of this application, a method embodiment for detecting transaction risk is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0037] The method embodiment provided in Embodiment 1 of this application can be executed in a mobile terminal, computer terminal or similar computing device. Figure 1 This is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for detecting transaction risks, according to Embodiment 1 of this application. Figure 1As shown, the computer terminal 10 (or mobile device) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0038] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0039] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the transaction risk detection method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the aforementioned transaction risk detection method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0040] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0041] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10 (or mobile device).

[0042] Under the aforementioned operating environment, this application provides the following: Figure 2 The method for detecting transaction risks is shown. Figure 2 This is a flowchart of an optional transaction risk detection method provided according to Embodiment 1 of this application.

[0043] Step S201: With the authorization of the target merchant, collect the transaction data of the target merchant, and perform data filling operation on the missing data in the transaction data to obtain the cleaned raw data.

[0044] The execution entity in this embodiment 1 can be a transaction risk detection system. This system detects potential risks in merchant transactions based on deep residual networks. Specifically, it can detect whether a merchant's credit loan carries default or overdue risk based on the loan amount, and further output the loan amount predicted by the model. In addition, the system can perform other transaction risk detection tasks by updating the model training set and training data labels, such as transaction compliance risk and illegal fund transfer risk. The transaction risk detection system collects transaction data, performs differentiated processing on time-series abnormal data, and uses a time window adaptive normalization method to normalize and concatenate the time-series data into separate windows. This constructs a high-dimensional differentiated input feature set containing original features, scenario-corrected features, and residual bias features. The trained deep residual network model is then used to train and infer from the input feature set, ultimately outputting the probability that a merchant loan transaction carries risk. This achieves the technical effect of overcoming the limitations of feature engineering in traditional methods and the problem of feature distortion caused by data preprocessing in complex and ever-changing merchant transaction scenarios, improving the accuracy of loan amount prediction, model convergence speed, and generalization ability, thereby assisting financial institutions in decision-making.

[0045] In this embodiment 1, in order to ensure the quality and consistency of subsequent deep residual network training data, the collected transaction data can be thoroughly cleaned with the authorization of the target merchant, and different algorithms can be used to fill in the missing data to obtain the cleaned original data, thereby reducing the bias caused by missing data and improving the stability of model training.

[0046] Step S202: Remove noise features from the original data based on the fluctuation time window and extract abnormal time series features. The fluctuation time window includes at least: holiday time window and industry periodic time window.

[0047] In this embodiment 1, in order to accurately distinguish between the actual business operation fluctuations and random noise of merchants and avoid the distortion of business characteristics caused by traditional data smoothing, the time series data of merchants can be classified according to the holiday time window (such as statutory holidays) and the industry periodic time window (such as the peak sales months of the retail and catering industries). The original peak season characteristics are retained, while the negative business time series characteristics are also retained. Local neighborhood residual correction and replacement are used for occasional noise anomalies, thereby eliminating random noise and extracting time series characteristics that conform to actual production activities. This can restore the actual business situation of merchants and improve the rationality of risk detection.

[0048] Step S203: Extract residual features from the original data based on the business scenario and fluctuation time window, and combine them with the original data to generate enhanced time series features.

[0049] In this embodiment 1, in order to capture the residual characteristics of merchants relative to the industry benchmark and enhance the model's ability to identify differentiated business models, the residual between the merchant's operating data and the industry benchmark of the same period can be calculated to generate deviation features, which together constitute a high-dimensional differentiated input feature set. This can improve the model's ability to capture complex data relationships and enhance the accuracy of risk detection.

[0050] Step S204: Input the transaction amount, abnormal time series features, and enhanced time series features of the target merchant into the credit risk detection model, and obtain the detection results output by the credit risk detection model. The credit risk detection model is a model trained based on a deep residual network model.

[0051] In this embodiment 1, to leverage the powerful feature extraction and gradient optimization capabilities of deep residual networks to achieve high-precision merchant transaction risk prediction, the target merchant's transaction amount, abnormal time-series features, and enhanced time-series features are used as input vectors. These are then fed into a credit risk detection model trained on a deep residual network for forward propagation calculation. The resulting risk score is used as the detection result, effectively mitigating gradient vanishing in deep networks and improving prediction accuracy and model robustness. Furthermore, the credit risk detection model can also output a recommended range of transaction amounts based on its risk score, assisting financial institutions in decision-making.

[0052] Optionally, in the transaction risk detection method provided in Embodiment 1 of this application, before inputting the transaction amount, abnormal time series features, and enhanced time series features of the target merchant into the credit risk detection model, the method further includes: processing historical transaction data to obtain historical abnormal time series features and historical enhanced time series features, and constructing a training set by combining the transaction amount of each transaction in the historical transaction data; extracting multiple candidate sample sets from the training set based on multiple candidate batches, training the deep residual network model using multiple candidate sample sets, evaluating the performance score of each candidate sample set based on evaluation metrics, and determining the target batch from multiple candidate batches based on the performance score; training the deep residual network model based on the target batch and the training set, determining the loss function value based on the model's output results and the transaction labels of historical merchants during the training process, and selecting the credit risk detection model from the model training results based on the changing trend of the loss function value.

[0053] In this embodiment 1, in order to construct a high-quality dataset suitable for training deep residual networks, the abnormal time-series features and historical enhanced time-series features of historical transaction data can be extracted and combined with the transaction amount to construct a training set. The model is trained based on the target batch and the final model is selected according to the trend of loss function changes. This can optimize the model hyperparameter configuration and improve the convergence speed and prediction accuracy of the credit risk detection model.

[0054] Specifically, firstly, historical transaction data is processed according to the method of extracting abnormal time-series features and enhanced time-series features from the original data of the target merchants in Embodiment 1, resulting in historical abnormal time-series features and historical enhanced time-series features. Combined with the transaction amount of each transaction (i.e., a specific numerical variable, such as a merchant's credit loan amount of 100,000 yuan), a training set containing feature vectors and labels (such as the actual approved loan amount for the merchant's credit loan, or the merchant's credit loan default status) is constructed. Then, multiple candidate batch sizes are set (e.g., integer values ​​such as 32, 64, 128, 256, etc.), and corresponding candidate sample sets are extracted from the training set. Secondly, these candidate sample sets are used to perform preliminary training on the deep residual network model, calculating the performance score of the evaluation index corresponding to each candidate sample set, and determining the target batch based on the score. Finally, the training set is formally trained using a defined target batch. During the training process, the difference between the model output and the historical merchant's real transaction tags is calculated in real time to determine the loss function value, and the changing trend of the loss function value is monitored (such as the curve of the loss value decreasing and stabilizing as the number of iterations increases). When the loss function value no longer decreases significantly or the performance of the validation set decreases, the model parameters at this time are selected as the final credit risk detection model.

[0055] By evaluating performance on multiple candidate sample sets based on evaluation metrics and determining the target batch, the problem of low training efficiency or unstable convergence caused by experience-dependent batch selection in traditional training can be solved, thus optimizing the allocation of training resources. Through nonlinear mapping learning of high-dimensional differentiated input features (abnormal and enhanced temporal features) using deep residual networks, complex nonlinear interactions in merchant operating data (such as the coupling effect between holiday fluctuations and industry cycles) can be captured. Training the model based on the target batch and selecting the credit risk detection model according to the trend of the loss function value (such as when the loss value decreases to a stable level or the validation set error begins to rise) can solve the overfitting or underfitting problems in traditional methods, improving the model's generalization ability and achieving the technical effect of improving detection accuracy.

[0056] Optionally, in the transaction risk detection method provided in Embodiment 1 of this application, multiple candidate sample sets are used to train the deep residual network model, and the performance score of each candidate sample set is evaluated based on the evaluation index, including: inputting each candidate sample set into the deep residual network model to obtain the output result of each candidate sample set; determining the root mean square error based on the output result of each candidate sample set and the transaction label to obtain the first prediction bias; determining the mean absolute error based on the output result of each candidate sample set and the transaction label to obtain the second prediction bias; determining the coefficient of determination based on the statistical characteristics of the output results of multiple candidate sample sets to obtain the third prediction bias; and determining the performance score of each candidate sample set based on the first prediction bias, the second prediction bias, and the third prediction bias.

[0057] In this embodiment 1, in order to comprehensively evaluate the training performance of the candidate sample set to determine the target batch, the root mean square error, mean absolute error and coefficient of determination can be calculated as prediction bias and the performance score can be determined in combination. This allows for multi-dimensional quantification of the model prediction accuracy to optimize the selection of hyperparameters.

[0058] Specifically, firstly, multiple candidate sample sets (e.g., sample sets with batch sizes of 32, 64, and 128) containing historical abnormal time-series features, historical enhanced time-series features, and transaction amount data are input one by one into the deep residual network model. The model outputs the corresponding risk score, for example, a risk probability of 80%. Additionally, the model can output a predicted loan amount, such as x yuan. Then, for each candidate sample set, the square root of the squared mean of the difference between its predicted value and the actual transaction label (e.g., whether the merchant's credit loan is in default, 100% for yes, 0% for no) is calculated to obtain the first prediction bias. Furthermore, the square root of the squared mean of the difference between the model's output predicted loan amount and the merchant's actual approved loan amount can also be calculated to obtain the first prediction bias, such as x yuan. Secondly, for each candidate sample set, the average of the absolute values ​​of the differences between its predicted value and the actual transaction label is calculated to obtain the second prediction bias, for example, the average of the absolute values ​​of the difference between the predicted risk probability and the actual default label, or the average of the absolute values ​​of the difference between the output predicted loan amount and the merchant's actual approved loan amount. Finally, the coefficient of determination is calculated based on the variance ratio between the prediction results of multiple candidate sample sets and the true labels to obtain the third prediction bias, and the performance score of each candidate sample set is calculated by combining the above three indicators.

[0059] The first prediction bias, obtained by calculating the root mean square error, reflects the average deviation between the predicted value and the actual transaction label. It is sensitive to outliers and helps identify prediction errors. The second prediction bias, obtained by calculating the mean absolute error, measures the sum of the absolute values ​​of prediction errors, providing a robust estimate of the error scale. The third prediction bias, obtained by calculating the coefficient of determination, measures the goodness of fit of the model to the observed data, reflecting the model's ability to explain data variation. By combining the first, second, and third prediction biases to determine the performance score, an objective and quantitative evaluation of the deep residual network model's performance on the candidate sample set is achieved from different statistical dimensions. This allows for the selection of candidate batches with better training performance, thereby ensuring that the final credit risk detection model has higher predictive accuracy.

[0060] Optionally, in the transaction risk detection method provided in Embodiment 1 of this application, residual features are extracted from the original data based on business scenarios and fluctuation time windows, and enhanced time-series features are generated by combining the original data. This includes: mapping the original data to an industry periodic time window, normalizing the transaction data of each time window, and concatenating them to obtain periodic features. The industry periodic time window includes at least a first time window and a second time window, where the transaction frequency of the first time window is greater than that of the second time window; obtaining the first statistical features of merchants in the target industry to which the target merchant belongs within the industry periodic time window, and determining the industry residual by combining them with the original data; obtaining the second statistical features of the surrounding merchants of the target merchant within the industry periodic time window, and determining the business district residual by combining them with the original data; and concatenating the original data, periodic features, industry residual, and business district residual to generate enhanced time-series features.

[0061] In this embodiment 1, in order to construct high-dimensional differentiated features that include industry cyclical patterns and internal and external relative performance to enhance the model input, periodic features can be generated by window normalization, industry and business district residuals can be calculated, and then spliced ​​to generate enhanced time series features, thereby preserving the true operating conditions of peak and off-peak seasons and improving the rationality of risk detection.

[0062] Specifically, the raw data is first divided into a high-frequency first time window (i.e., peak season, such as periods with more than 100 transactions per day) and a low-frequency second time window (i.e., off-season, such as periods with fewer than 10 transactions per day) based on transaction frequency. Additionally, a third time window (i.e., off-season) can be defined, with a transaction frequency lower than the first time window but higher than the second. The data within each window is independently normalized and concatenated to obtain periodic features. Then, statistical features (such as average and median) of other merchants in the target merchant's industry within the same time window are obtained. These are combined with the target merchant's raw data to calculate the difference and determine the industry residual. Next, statistical features of other merchants within the target merchant's surrounding business district (i.e., all merchants within a predefined geographical area centered on the target merchant) within the same time window are obtained. These are combined with the target merchant's raw data to calculate the difference and determine the business district residual. Finally, the raw data, periodic features, industry residual, and business district residual are vector-concatenated to generate enhanced time-series features for model input.

[0063] By dividing the data into a first time window (peak season) and a second time window (off-season) based on transaction frequency differences and independently normalizing the data for each window, the collapse of peak and off-season characteristics caused by global normalization can be eliminated, preserving the real fluctuation patterns of merchants' business operations in different periods and achieving accurate extraction of periodic features. By obtaining the statistical characteristics of the target merchant's industry to determine the industry residual and obtaining the statistical characteristics of surrounding merchants to determine the business district residual, the relative advantages or disadvantages of merchants in the industry can be quantified. By concatenating the original data, periodic features, industry residuals, and business district residuals to generate enhanced time-series features, the model input dimensions are enriched, enabling the deep residual network to simultaneously capture the multidimensional nonlinear relationship between the merchant's business operations and the industry environment, thus improving the model's ability to characterize the merchant's real risk situation.

[0064] Optionally, in the transaction risk detection method provided in Embodiment 1 of this application, noise features are removed from the original data based on a fluctuation time window, and abnormal time-series features are extracted. This includes: sorting the transaction data in the original data according to time order to obtain transaction time-series data; identifying noise data in the transaction time-series data based on a preset threshold, and replacing the noise data based on the statistical features of the context time-series data of the noise data; identifying whether there is a downward trend in the transaction features in the transaction time-series data based on a preset time window, and determining the trading features of the preset time window as decay risk features if there is a downward trend; extracting target time-series data from the transaction time-series data based on the fluctuation time window, and filtering compliant time-series data based on the context data of the target time-series data; and determining abnormal time-series features based on compliant time-series data and decay risk features.

[0065] In this embodiment 1, in order to accurately identify and extract abnormal time-series features that reflect the true operating status of merchants from the original transaction data, abnormal time-series features can be generated by sorting transaction data, noise replacement, attenuation feature identification and compliance time-series screening. This can eliminate random noise interference and retain the true operating status of merchants, thereby improving the effectiveness and authenticity of the features.

[0066] Specifically, the process begins by arranging the original transaction data chronologically to form transaction time series data (e.g., daily transaction records from year x month x day to year x month x day). Then, noisy data is identified based on a preset threshold (e.g., a single transaction exceeding x times the average daily transaction amount), and replaced with the mean or median of its preceding and following data. Next, based on a preset time window (e.g., x consecutive days), the process checks whether the transaction characteristics exhibit a monotonically decreasing trend with a slope greater than a preset slope. If so, the data within that window is marked as decay risk characteristics. Finally, target time series data is extracted based on fluctuation time windows (e.g., holidays or peak season periods), and compliant time series data conforming to industry patterns is selected and merged with the decay risk characteristics to generate abnormal time series characteristics.

[0067] By replacing noisy data with contextual statistical features, dirty data caused by occasional test transactions or system errors can be eliminated, avoiding interference from noise in model training. By distinguishing between compliant fluctuations and abnormal fluctuations during holidays or peak seasons, and identifying the downward trend of transaction features and determining decay risk features, the true operating conditions of merchants are preserved, allowing the residual network to learn risk evolution patterns based on real conditions. By determining abnormal time series features based on the above features, a high-dimensional differentiated input feature set including noise correction, risk decay, and compliance fluctuation correction is constructed, enabling the deep residual network to learn more complex nonlinear risk patterns, thereby achieving the technical effect of improving the risk prediction accuracy of the deep residual network.

[0068] Optionally, in the transaction risk detection method provided in Embodiment 1 of this application, a data imputation operation is performed on the missing data in the transaction data to obtain cleaned original data, including: traversing the numerical data and categorical data in the transaction data to determine the missing proportion of the numerical data and the missing proportion of the categorical data; for numerical data with a missing proportion lower than a preset threshold, determining the third statistical feature of the non-missing sample corresponding to the numerical data, and imputing the missing data of the numerical data according to the third statistical feature; for numerical data with a missing proportion higher than a preset threshold, using an interpolation algorithm to process the historical data of the numerical data, and imputing the missing data of the numerical data according to the processing result; for categorical data with a missing proportion lower than a preset threshold, determining the fourth statistical feature of the non-missing sample corresponding to the categorical data, and imputing the missing data of the categorical data according to the fourth statistical feature; for categorical data with a missing proportion higher than a preset threshold, imputing the missing data of the categorical data according to a new category.

[0069] In this embodiment 1, in order to adopt differentiated imputation strategies for numerical and categorical data with different degrees of missingness to ensure data quality, the missing proportion can be statistically analyzed and the missing data can be imputed according to statistical characteristics, interpolation algorithms or new categories, thereby preserving the data distribution characteristics and reducing the negative impact of missing values ​​on model training.

[0070] Specifically, the process first iterates through the merchant's historical business flow data and historical credit data, calculating the missing percentages of numerical fields (such as average monthly transaction amount) and categorical fields (such as industry type). If the missing percentage of a numerical field is 5% (below the preset threshold of 10%), the statistical characteristics of the non-missing samples for that field (such as mean, median, etc.) are calculated as the third statistical characteristic and used to fill in the missing values. Then, for numerical fields with a missing percentage of 80% (above the preset threshold), the K-nearest neighbor algorithm or random forest algorithm is used to interpolate based on the historical data of other related fields and fill in the missing values. Next, for categorical fields with a missing percentage of 5%, the statistical characteristics of the non-missing samples for that field (such as mode, etc.) are calculated as the fourth statistical characteristic and used to fill in the missing values. Finally, for categorical fields with a missing percentage of 80%, a new "Unknown Industry" category label (i.e., the new category mentioned above) is added to fill in the missing data.

[0071] By statistically analyzing the proportion of missing numerical and categorical data, the degree of missing information can be quantified, allowing for the selection of the most appropriate imputation strategy. Implanting data using the statistical characteristics of non-missing samples preserves the original statistical distribution of the data, avoiding the introduction of excessive noise. Employing K-nearest neighbor interpolation or random forest-based imputation algorithms leverages the complex nonlinear relationships between data points for more accurate estimation, compensating for the shortcomings of simple statistical imputation. Using newly added categories for imputation preserves the risk signals inherent in the missing information itself (i.e., missing data may indicate unstable business operations), avoiding information loss caused by forced categorization. Through these steps, the nonlinear risk logic behind missing transaction data can be more accurately reflected, achieving the technical effect of improving the completeness and consistency of training data and providing reliable input for deep residual networks.

[0072] Optionally, in the transaction risk detection method provided in Embodiment 1 of this application, the collection of transaction data of the target merchant includes: extracting historical business flow data of the target merchant from the financial institution's transaction system, wherein the historical business flow data includes: historical transaction data and historical business attribute data, and the historical transaction data includes at least: historical lending data; obtaining historical credit data of the target merchant from the financial institution's risk control system, wherein the historical credit data includes: credit score and historical default data; determining the target industry to which the target merchant belongs and obtaining external environment data of the target industry; and determining the transaction data of the target merchant based on the historical business flow data, historical credit data, and external environment data.

[0073] In this embodiment 1, in order to construct multi-dimensional input data for merchant transaction risk detection, transaction data can be generated by collecting merchants' historical business, credit and external industry environment data, thereby improving the model's ability to comprehensively capture the merchant's business operation status and risk characteristics.

[0074] Specifically, the process begins by retrieving historical business flow data of the target merchant from the financial institution's core transaction system. This data encompasses historical transaction records and business attributes, with historical lending data including past loan disbursement records, repayment plans, and actual amounts paid. Next, historical credit data of the target merchant is obtained from the financial institution's risk control management system database. This data includes credit scores calculated based on internal models and historical default records, with historical default data including the number of overdue days, number of defaults, and bad debt write-offs over the past three years. Then, the target industry category is determined through the merchant's registration information, and external environment data for this industry is obtained from publicly available data sources. This external environment data includes the industry's average growth rate, regional growth rate, and industry prosperity index. Finally, the aforementioned multi-source heterogeneous data is aligned, cleaned, and standardized to determine the target merchant's transaction data.

[0075] By collecting merchants' historical business flow data, historical credit data, and external environment data of the target industry, a deep integration of static credit characteristics, dynamic business operation time-series characteristics, and external environment characteristics is achieved. This processing method can comprehensively reflect the merchants' true operating status, credit loan repayment willingness, and the impact of the external environment, and uncover nonlinear correlations and potential risk patterns that are difficult to reflect from a single data source, providing high-quality data for model input.

[0076] Optionally, in this embodiment 1, Figure 3 This is a flowchart illustrating an optional merchant credit loan transaction risk detection method provided in Embodiment 1 of this application. Figure 3 As shown, the process first collects multidimensional data from merchants, including historical business flow data, historical credit data, and industry external environment data. Then, the data is preprocessed, including missing value handling, removal of occasional noise anomalies, preservation of original time-series features and business decline trend features, and independent normalization and residual feature enhancement for different time windows. Next, the processed data is input into a credit risk detection model for forward propagation, using a deep residual network to extract features and calculate predicted values. Finally, the probability of credit loan risk and the model's predicted credit loan amount are output.

[0077] Optionally, in this embodiment 1, Figure 4 This is a schematic diagram illustrating the process of constructing and training an optional credit risk detection model according to Embodiment 1 of this application. Figure 4 As shown, the deep residual network model is first constructed, including designing a residual block structure containing backbone paths and shortcut paths, determining whether to use ReLU or Leaky ReLU as the activation function, and defining the mean squared error loss function and Adam optimizer. Then, model training and optimization are performed, specifically including constructing a dataset containing training, validation, and test sets, and experimentally determining the target batch size to balance training efficiency and performance. Next, the model is trained using this dataset, calculating the loss function value during training to monitor convergence, and iteratively optimizing the model parameters through backpropagation. Finally, a credit risk detection model that meets the convergence requirements is obtained, which can be used for subsequent credit loan risk detection and credit loan amount prediction tasks.

[0078] In this embodiment 1, Figure 5 This is a schematic diagram illustrating the specific process of input data processing and feature engineering for the optional credit risk detection model provided in Embodiment 1 of this application. Figure 5As shown, the process begins with data cleaning and outlier identification. Missing values ​​are imputed using the mean, median, K-nearest neighbors, or random forest. Occasional noise anomalies are corrected using local neighborhood residuals, while preserving the original time-series characteristics of holiday compliance fluctuations and business decline trends. Next, adaptive time window normalization is implemented. Based on the merchant's industry and time window label, the time-series data is divided into peak, off-peak, and low-peak season windows. Each window is independently normalized, and features are concatenated to eliminate seasonal feature collapse, resulting in periodic features. Then, time-series residual feature enhancement is performed. Positive and negative residuals are calculated between daily operating data and the industry and business district benchmarks for the same period, generating features reflecting a merchant's relative excess or disadvantageous operating capabilities compared to peers—the aforementioned industry and business district residuals. Finally, the original time-series features, periodic features, industry residuals, and business district residuals are combined to form a high-dimensional differentiated input feature set, which serves as the input data for the deep residual network.

[0079] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0080] In summary, the transaction risk detection method provided in this application ensures the integrity and consistency of the data foundation by collecting multidimensional merchant data and filling in missing values. It differentiates random noise by utilizing holiday and industry-specific periodic time windows, using the merchant's true operating characteristics as abnormal time-series features, thus avoiding the distortion of operating characteristics caused by traditional global smoothing. Furthermore, it calculates residuals based on business scenarios to generate enhanced time-series features, constructs a high-dimensional differentiated input feature set, and inputs it into a credit risk detection model trained on a deep residual network. The residual connection structure effectively alleviates the gradient vanishing problem in deep network training, and the nonlinear feature mapping captures complex nonlinear relationships and potential patterns in merchant operating data, achieving the technical effect of improving the accuracy of transaction risk assessment. Therefore, it can solve the technical problem that traditional transaction risk detection methods in related technologies typically rely on linear feature extraction, which is difficult to fully capture nonlinear relationships and potential patterns in the data, leading to low detection accuracy. This method achieves the technical effect of improving the accuracy of merchant transaction risk detection and enhancing the model's ability to process complex data.

[0081] Example 2

[0082] This application also provides a transaction risk detection device. It should be noted that the transaction risk detection device of this application can be used to execute the transaction risk detection method provided in this application. The transaction risk detection device provided in this application is described below.

[0083] According to an embodiment of this application, an apparatus for implementing the above-described method for detecting transaction risks is also provided. Figure 6 This is a schematic diagram of a transaction risk detection device provided according to Embodiment 2 of this application. Figure 6 As shown, the device includes: a collection unit 601, a first extraction unit 602, a second extraction unit 603, and a detection unit 604.

[0084] Specifically, the collection unit 601 is used to collect the transaction data of the target merchant with the authorization of the target merchant, and to fill in the missing data in the transaction data to obtain the cleaned raw data.

[0085] The first extraction unit 602 is used to remove noise features from the original data based on the fluctuation time window and extract abnormal time series features, wherein the fluctuation time window includes at least: holiday time window and industry periodic time window.

[0086] The second extraction unit 603 is used to extract residual features from the original data based on the business scenario and fluctuation time window, and combine the original data to generate enhanced time series features.

[0087] The detection unit 604 is used to input the transaction amount, abnormal time series features and enhanced time series features of the target merchant into the credit risk detection model and obtain the detection results output by the credit risk detection model. The credit risk detection model is a model trained based on a deep residual network model.

[0088] The transaction risk detection device provided in this application embodiment, based on a collection unit 601, a first extraction unit 602, a second extraction unit 603, and a detection unit 604, ensures the integrity and consistency of the data foundation by collecting multidimensional data of merchants and filling in missing values. It differentiates random noise by utilizing holiday and industry-specific periodic time windows and uses the merchants' true operating characteristics as abnormal time-series features, avoiding the distortion of operating characteristics caused by traditional global smoothing. Furthermore, it calculates residuals based on business scenarios to generate enhanced time-series features, constructs a high-dimensional differentiated input feature set, and inputs it into a credit risk detection model trained based on a deep residual network. The residual connection structure effectively alleviates the gradient vanishing problem in deep network training, and the nonlinear feature mapping captures complex nonlinear relationships and potential patterns in merchant operating data, achieving the technical effect of improving the accuracy of transaction risk assessment. Therefore, it can solve the technical problem that traditional transaction risk detection methods in related technologies typically rely on linear feature extraction, which is difficult to fully capture nonlinear relationships and potential patterns in the data, resulting in low detection accuracy. This achieves the technical effect of improving the accuracy of merchant transaction risk detection and enhancing the model's ability to process complex data.

[0089] Optionally, in the transaction risk detection device provided in Embodiment 2 of this application, the device further includes: a processing unit, used to process historical transaction data to obtain historical abnormal time series features and historical enhanced time series features before inputting the transaction amount, abnormal time series features, and enhanced time series features of the target merchant into the credit risk detection model, and to construct a training set by combining the transaction amount of each transaction in the historical transaction data; a first training unit, used to extract multiple candidate sample sets from the training set based on multiple candidate batches, use multiple candidate sample sets to train the deep residual network model, evaluate the performance score of each candidate sample set based on the evaluation index, and determine the target batch from multiple candidate batches based on the performance score; and a second training unit, used to train the deep residual network model based on the target batch and the training set, determine the loss function value based on the output result of the model during the training process and the transaction label of the historical merchant, and select the credit risk detection model from the model training results based on the changing trend of the loss function value.

[0090] Optionally, in the transaction risk detection device provided in Embodiment 2 of this application, the first training unit includes: a first processing subunit, used to input each candidate sample set into the deep residual network model to obtain the output result of each candidate sample set; a first determination subunit, used to determine the root mean square error based on the output result of each candidate sample set and the transaction label to obtain a first prediction bias; a second determination subunit, used to determine the mean absolute error based on the output result of each candidate sample set and the transaction label to obtain a second prediction bias; a third determination subunit, used to determine the coefficient of determination based on the statistical characteristics of the output results of multiple candidate sample sets to obtain a third prediction bias; and a fourth determination subunit, used to determine the performance score of each candidate sample set based on the first prediction bias, the second prediction bias, and the third prediction bias.

[0091] Optionally, in the transaction risk detection device provided in Embodiment 2 of this application, the second extraction unit 603 includes: a second processing subunit, used to map the original data to an industry periodic time window, normalize the transaction data of each time window, and splice them to obtain periodic features, wherein the industry periodic time window includes at least a first time window and a second time window, and the transaction frequency of the first time window is greater than the transaction frequency of the second time window; a first acquisition subunit, used to acquire the first statistical features of merchants in the target industry to which the target merchant belongs in the industry periodic time window, and determine the industry residual in combination with the original data; a second acquisition subunit, used to acquire the second statistical features of the surrounding merchants of the target merchant in the industry periodic time window, and determine the business district residual in combination with the original data; and a splicing subunit, used to splice the original data, periodic features, industry residual and business district residual to generate enhanced time-series features.

[0092] Optionally, in the transaction risk detection device provided in Embodiment 2 of this application, the first extraction unit 602 includes: a sorting subunit, used to sort the transaction data in the original data according to the time order to obtain transaction time series data; a replacement subunit, used to identify noise data in the transaction time series data according to a preset threshold, and replace the noise data based on the statistical characteristics of the context time series data of the noise data; an identification subunit, used to identify whether there is a downward trend in the transaction characteristics in the transaction time series data based on a preset time window, and if there is a downward trend, determine it as a decay risk feature based on the transaction characteristics of the preset time window; a first extraction subunit, used to extract target time series data from the transaction time series data according to the fluctuation time window, and filter compliant time series data based on the context data of the target time series data; and a fifth determination subunit, used to determine abnormal time series features based on compliant time series data and decay risk features.

[0093] Optionally, in the transaction risk detection device provided in Embodiment 2 of this application, the aforementioned acquisition unit 601 includes: a sixth determining subunit, used to traverse numerical data and categorical data in transaction data, and determine the missing proportion of numerical data and the missing proportion of categorical data; a seventh determining subunit, used to determine the third statistical feature of the non-missing sample corresponding to the numerical data with a missing proportion lower than a preset threshold, and fill the missing data of the numerical data according to the third statistical feature; a first filling subunit, used to process the historical data of the numerical data with a missing proportion higher than a preset threshold using an interpolation algorithm, and fill the missing data of the numerical data according to the processing result; a second filling subunit, used to determine the fourth statistical feature of the non-missing sample corresponding to the categorical data with a missing proportion lower than a preset threshold, and fill the missing data of the categorical data according to the fourth statistical feature; and a third filling subunit, used to fill the missing data of the categorical data with a missing proportion higher than a preset threshold according to a new category.

[0094] Optionally, in the transaction risk detection device provided in Embodiment 2 of this application, the aforementioned acquisition unit 601 includes: a first extraction subunit, used to extract historical business flow data of the target merchant from the financial institution's transaction system, wherein the historical business flow data includes: historical transaction data and historical business attribute data, and the historical transaction data includes at least: historical lending data; a third acquisition subunit, used to acquire historical credit data of the target merchant from the financial institution's risk control system, wherein the historical credit data includes: credit score and historical default data; a third acquisition subunit, used to determine the target industry to which the target merchant belongs and acquire external environment data of the target industry; and an eighth determination subunit, used to determine the transaction data of the target merchant based on the historical business flow data, historical credit data, and external environment data.

[0095] It should be noted that the acquisition unit 601, the first extraction unit 602, the second extraction unit 603, and the detection unit 604 mentioned above correspond to steps S201 to S204 in Embodiment 1. The two modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules or units can be hardware or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above modules can also be part of the device and run in the computer terminal 10 provided in Embodiment 1.

[0096] Example 3

[0097] Embodiments of this application may provide an electronic device. Figure 7 This is a schematic diagram of an electronic device for detecting transaction risks according to Embodiment 3 of this application. Figure 7 As shown, the electronic device may include: one or more ( Figure 7 (Only one is shown) processor 702, memory 704, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.

[0098] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the methods and apparatus in the embodiments of this application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the above-described methods. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0099] The processor can access information and applications stored in memory via a transmission device to perform the following steps: With authorization from the target merchant, collect the target merchant's transaction data and fill in any missing data to obtain cleaned raw data; remove noise features from the raw data based on fluctuation time windows and extract abnormal time-series features, wherein the fluctuation time windows include at least: holiday time windows and industry periodic time windows; extract residual features from the raw data based on business scenarios and fluctuation time windows, and combine the raw data to generate enhanced time-series features; input the target merchant's transaction amount, abnormal time-series features, and enhanced time-series features into a credit risk detection model to obtain the detection results output by the credit risk detection model, wherein the credit risk detection model is a model trained based on a deep residual network model.

[0100] The processor can access information and applications stored in the memory via a transmission device to perform the following steps: Before inputting the target merchant's transaction amount, abnormal time-series features, and enhanced time-series features into the credit risk detection model, the method further includes: processing historical transaction data to obtain historical abnormal time-series features and historical enhanced time-series features, and constructing a training set by combining the transaction amount of each transaction in the historical transaction data; extracting multiple candidate sample sets from the training set based on multiple candidate batches, training the deep residual network model using multiple candidate sample sets, evaluating the performance score of each candidate sample set based on evaluation metrics, and determining the target batch from multiple candidate batches based on the performance score; training the deep residual network model based on the target batch and the training set, determining the loss function value based on the model's output results and historical merchant transaction labels during the training process, and selecting the credit risk detection model from the model training results based on the changing trend of the loss function value.

[0101] The processor can access information and applications stored in memory via a transmission device to perform the following steps: training a deep residual network model using multiple candidate sample sets, and evaluating the performance score of each candidate sample set based on evaluation metrics, including: inputting each candidate sample set into the deep residual network model to obtain the output result of each candidate sample set; determining the root mean square error based on the output result of each candidate sample set and the transaction label to obtain a first prediction bias; determining the mean absolute error based on the output result of each candidate sample set and the transaction label to obtain a second prediction bias; determining the coefficient of determination based on the statistical characteristics of the output results of multiple candidate sample sets to obtain a third prediction bias; and determining the performance score of each candidate sample set based on the first prediction bias, the second prediction bias, and the third prediction bias.

[0102] The processor can access information and applications stored in memory via a transmission device to execute the following steps: extracting residual features from the raw data based on business scenarios and fluctuation time windows, and generating enhanced time-series features by combining the raw data, including: mapping the raw data to industry periodic time windows, normalizing the transaction data in each time window, and concatenating them to obtain periodic features, wherein the industry periodic time window includes at least a first time window and a second time window, with the transaction frequency of the first time window being greater than that of the second time window; obtaining the first statistical features of merchants in the target industry to which the target merchant belongs within the industry periodic time window, and determining the industry residual by combining them with the raw data; obtaining the second statistical features of the surrounding merchants of the target merchant within the industry periodic time window, and determining the business district residual by combining them with the raw data; and concatenating the raw data, periodic features, industry residual, and business district residual to generate enhanced time-series features.

[0103] The processor can access information and applications stored in the memory via a transmission device to perform the following steps: removing noise features from the original data based on a fluctuation time window and extracting abnormal time-series features, including: sorting the transaction data in the original data according to time order to obtain transaction time-series data; identifying noise data in the transaction time-series data based on a preset threshold, and replacing the noise data based on the statistical features of the context time-series data of the noise data; identifying whether there is a downward trend in the transaction features in the transaction time-series data based on a preset time window, and determining the trading features of the preset time window as decay risk features if a downward trend exists; extracting target time-series data from the transaction time-series data based on the fluctuation time window, and filtering compliant time-series data based on the context data of the target time-series data; and determining abnormal time-series features based on compliant time-series data and decay risk features.

[0104] The processor can access information and applications stored in memory via a transmission device to perform the following steps: performing data imputation on missing data in transaction data to obtain cleaned original data, including: traversing numerical and categorical data in the transaction data to determine the missing proportions of numerical and categorical data; for numerical data with a missing proportion below a preset threshold, determining the third statistical feature of the corresponding non-missing samples and imputing the missing data based on the third statistical feature; for numerical data with a missing proportion above a preset threshold, processing the historical data of the numerical data using an interpolation algorithm and imputing the missing data based on the processing result; for categorical data with a missing proportion below a preset threshold, determining the fourth statistical feature of the corresponding non-missing samples and imputing the missing data based on the fourth statistical feature; and for categorical data with a missing proportion above a preset threshold, imputing the missing data based on a new category.

[0105] The processor can access information and applications stored in the memory via a transmission device to perform the following steps: collecting transaction data of the target merchant, including: extracting historical business flow data of the target merchant from the financial institution's transaction system, wherein the historical business flow data includes: historical transaction data and historical business attribute data, and the historical transaction data includes at least: historical lending data; obtaining historical credit data of the target merchant from the financial institution's risk control system, wherein the historical credit data includes: credit score and historical default data; determining the target industry to which the target merchant belongs and obtaining external environmental data of the target industry; and determining the transaction data of the target merchant based on the historical business flow data, historical credit data, and external environmental data.

[0106] This application provides a method for detecting transaction risks. By collecting multidimensional merchant data and imputing missing values, the integrity and consistency of the data foundation are ensured. Random noise is differentially removed using holiday and industry-specific periodic time windows, and the merchant's true operating characteristics are used as abnormal time-series features, avoiding the distortion of operating characteristics caused by traditional global smoothing. Furthermore, residuals are calculated based on business scenarios to generate enhanced time-series features, constructing a high-dimensional differentiated input feature set. This set is then input into a credit risk detection model trained on a deep residual network. The residual connection structure effectively alleviates the gradient vanishing problem in deep network training, and nonlinear feature mapping captures complex nonlinear relationships and potential patterns in merchant operating data, achieving the technical effect of improving the accuracy of transaction risk assessment. Therefore, this method solves the problem that traditional transaction risk detection methods often rely on linear feature extraction, which is difficult to fully capture nonlinear relationships and potential patterns in the data, leading to low detection accuracy. This method improves the accuracy of merchant transaction risk detection and enhances the model's ability to process complex data.

[0107] Those skilled in the art will understand that Figure 7 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones, tablets, handheld computers, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 7 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 7 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 7 The different configurations shown.

[0108] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0109] Example 4

[0110] Embodiments of this application also provide a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the transaction risk detection method provided in Embodiment 1.

[0111] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0112] This application also provides a computer program product, which, when executed on a data processing device, is suitable for performing steps of a method for detecting transaction risks.

[0113] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0114] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0115] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0116] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0117] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0118] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0119] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for detecting transaction risk, characterized in that, include: With the authorization of the target merchant, the transaction data of the target merchant is collected, and the missing data in the transaction data is filled in to obtain the cleaned original data. Noise features are removed from the original data based on fluctuation time windows, and abnormal time series features are extracted. The fluctuation time windows include at least: holiday time windows and industry periodic time windows. Based on the business scenario and the fluctuation time window, residual features are extracted from the original data, and enhanced time-series features are generated by combining the original data. The transaction amount of the target merchant, the abnormal time series features, and the enhanced time series features are input into the credit risk detection model to obtain the detection results output by the credit risk detection model, wherein the credit risk detection model is a model trained based on a deep residual network model.

2. The method according to claim 1, characterized in that, Before inputting the target merchant's transaction amount, the abnormal time-series features, and the enhanced time-series features into the credit risk detection model, the method further includes: By processing historical transaction data, historical abnormal time series features and historical enhanced time series features are obtained, and a training set is constructed by combining the transaction amount of each transaction in the historical transaction data. Multiple candidate sample sets are extracted from the training set based on multiple candidate batches. The deep residual network model is trained using the multiple candidate sample sets. The performance score of each candidate sample set is evaluated based on the evaluation metric. The target batch is determined from the multiple candidate batches based on the performance score. The deep residual network model is trained based on the target batch and the training set. The loss function value is determined based on the model's output during training and the transaction tags of historical merchants. The credit risk detection model is then selected from the model training results based on the changing trend of the loss function value.

3. The method according to claim 2, characterized in that, The deep residual network model is trained using the multiple candidate sample sets, and the performance score of each candidate sample set is evaluated based on evaluation metrics, including: Each candidate sample set is input into the deep residual network model to obtain the output result of each candidate sample set; The root mean square error is determined based on the output of each candidate sample set and the transaction label, thus obtaining the first prediction bias. The average absolute error is determined based on the output of each candidate sample set and the transaction label, thus obtaining the second prediction bias. The determination coefficients are determined based on the statistical characteristics of the output results of the multiple candidate sample sets, and the third prediction bias is obtained. The performance score of each candidate sample set is determined based on the first prediction bias, the second prediction bias, and the third prediction bias.

4. The method according to claim 1, characterized in that, Based on the business scenario and the fluctuation time window, residual features are extracted from the original data, and enhanced time-series features are generated by combining the original data, including: The original data is mapped to the industry periodic time window, the transaction data of each time window is normalized, and the periodic features are spliced ​​together. The industry periodic time window includes at least a first time window and a second time window, and the transaction frequency of the first time window is greater than the transaction frequency of the second time window. Obtain the first statistical characteristics of merchants in the target industry to which the target merchant belongs within the periodic time window of the industry, and determine the industry residual by combining the original data; Obtain the second statistical characteristics of the surrounding merchants of the target merchant within the industry's periodic time window, and combine them with the original data to determine the business district residual; The original data, the periodic features, the industry residuals, and the business district residuals are concatenated to generate the enhanced time-series features.

5. The method according to claim 1, characterized in that, Based on the fluctuation time window, noise features are removed from the original data, and abnormal time series features are extracted, including: The transaction data in the original data is sorted in chronological order to obtain transaction time-series data; Noise data in the transaction time series data is identified based on a preset threshold, and the noise data is replaced based on the statistical characteristics of the context time series data of the noise data. Based on a preset time window, identify whether there is a downward trend in the transaction characteristics in the transaction time series data. If there is a downward trend, determine the transaction characteristics as decay risk characteristics based on the preset time window. Target time series data is extracted from the transaction time series data based on the fluctuation time window, and compliant time series data is filtered based on the context data of the target time series data. The abnormal time series characteristics are determined based on the compliant time series data and the attenuation risk characteristics.

6. The method according to claim 1, characterized in that, The missing data in the transaction data is filled in to obtain the cleaned original data, including: Iterate through the numerical and categorical data in the transaction data to determine the missing proportions of the numerical data and the missing proportions of the categorical data; For numerical data with a missing proportion lower than a preset threshold, a third statistical feature of the non-missing samples corresponding to the numerical data is determined, and the missing data of the numerical data is filled in according to the third statistical feature. For numerical data with a missing proportion higher than the preset threshold, an interpolation algorithm is used to process the historical data of the numerical data, and the missing data of the numerical data is filled in according to the processing result. For categorical data with a missing proportion lower than the preset threshold, a fourth statistical feature of the non-missing samples corresponding to the categorical data is determined, and the missing data of the categorical data is filled in according to the fourth statistical feature; For categorical data with a missing proportion higher than the preset threshold, the missing data of that categorical data is filled in according to a new category.

7. The method according to claim 1, characterized in that, Collect transaction data from target merchants, including: Extract the target merchant's historical business flow data from the financial institution's transaction system. The historical business flow data includes: historical transaction data and historical business attribute data. The historical transaction data includes at least: historical lending data. The historical credit data of the target merchant is obtained from the risk control system of the financial institution, wherein the historical credit data includes: credit score and historical default data; Determine the target industry to which the target merchant belongs, and obtain the external environment data of the target industry; The transaction data of the target merchant is determined based on the historical business flow data, the historical credit data, and the external environment data.

8. A device for detecting transaction risk, characterized in that, include: The data collection unit is used to collect the transaction data of the target merchant when authorized by the target merchant, and to fill in the missing data in the transaction data to obtain the cleaned raw data. The first extraction unit is used to remove noise features from the original data based on the fluctuation time window and extract abnormal time series features, wherein the fluctuation time window includes at least: holiday time window and industry periodic time window; The second extraction unit is used to extract residual features from the original data based on the business scenario and the fluctuation time window, and to generate enhanced time-series features in combination with the original data; The detection unit is used to input the transaction amount of the target merchant, the abnormal time series features, and the enhanced time series features into the credit risk detection model, and obtain the detection results output by the credit risk detection model, wherein the credit risk detection model is a model trained based on a deep residual network model.

9. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program, when running, executes the transaction risk detection method according to any one of claims 1 to 7.

10. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the transaction risk detection method according to any one of claims 1 to 7.