Error transaction risk prediction method and device and computer readable storage medium
The LSTM model predicts the amount of transaction errors and the random forest model predicts the error risk level, and the feature screening is combined with the Lasso model to solve the problem of difficulty in accurately predicting the amount of transaction errors and the degree of risk in the existing technology, and improves the efficiency and accuracy of error adjustment.
Patent Information
- Application Number
- CN202411917915.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-15
AI Technical Summary
It is difficult for the prior art to accurately predict the number of transaction errors and the degree of error risk, resulting in a decrease in error adjustment efficiency and an increase in customer complaints.
The LSTM model is used to predict the amount of transaction errors, and the risk level of transaction errors is predicted through the random forest model, and feature screening is combined with the Lasso model to improve the prediction accuracy.
Accurate prediction of the amount and risk level of transaction errors is achieved, the efficiency of error adjustment is improved, and customer complaints and financial risks are reduced.
Smart Images

Figure CN119831603A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of risk prediction for error transactions, and in particular, to a method, device, computer-readable storage medium and electronic device for risk prediction for error transactions. Background Art
[0002] There are two types of risks in the existing error handling business scenarios: 1. Error adjustment risk caused by a sudden increase in the amount of errors. The transaction volume (including single channels and all channels) cannot be predicted in advance. Changes in the transaction volume will cause changes in the amount of errors. In the case of a sudden increase in the transaction volume, the amount of errors will also increase accordingly. The fluctuations in the amount of errors and the irregular and sharp increase in the amount of errors cause certain difficulties for the arrangement of error adjustment business personnel and related system error adjustment personnel. In the case of a sudden increase in the amount of errors, the efficiency of error adjustment will be affected to a certain extent, which may cause customer complaints or bank short-term fund risks. 2. The risk of reviewing transactions newly connected to error adjustment. For the review of newly connected error transactions, the risk can only be judged manually at present. However, manual judgment can only judge the risk level of errors in transactions through the number information. It cannot comprehensively analyze all the risk points involved in the exchange, which causes certain risks. And when there are major changes in the business and a large number of transactions need to be connected to errors, the efficiency of manual evaluation will be greatly limited. Summary of the invention
[0003] The main purpose of the present application is to provide a risk prediction method, device, computer-readable storage medium and electronic device for error transactions, so as to at least solve the problem that the prior art cannot accurately predict the amount of transaction errors and the degree of error risk.
[0004] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a risk prediction method for erroneous transactions is provided, comprising: obtaining first training data and second training data, wherein the first training data includes a first preset characteristic value and a transaction error amount, and the second training data includes a second preset characteristic value and a transaction error rate; using the first training data to train an LSTM model to obtain a first prediction model, and using the second training data to train a random forest model to obtain a second prediction model; obtaining data to be predicted, and inputting the data to be predicted into the first prediction model and the second prediction model respectively to obtain a risk prediction result, wherein the prediction result includes the total business prediction error number and the number of each business prediction error in a preset time period predicted by the first prediction model, and the transaction error probability level of the preset time period predicted by the second prediction model.
[0005] Optionally, the second training data is used to train the random forest model to obtain the second prediction model, including: using the Lasso model to filter the second preset characteristic value in the second training data to obtain the filtered third training data; using the third training data to train the random forest model to obtain the second prediction model.
[0006] Optionally, before using the first training data to train the LSTM model, the method also includes: determining whether the first training data has eigenvalue defects, wherein the eigenvalue defects include missing eigenvalues and eigenvalue errors; before using the second training data to train the random forest model, the method also includes: determining whether the second training data has the eigenvalue defects.
[0007] Optionally, after determining whether the second training data has the characteristic value defect, the method further includes: in the case where it is determined that the second training data has the characteristic value defect, determining the defect type of the characteristic value defect of the second training data; and according to the defect type, correcting the characteristic value defect of the second training data using a preset correction rule to obtain the corrected second training data.
[0008] Optionally, after using the Lasso model to screen the second preset feature value in the second training data to obtain the screened third training data, the method further includes: dividing the transaction error probability level according to the transaction error rate, and determining the transaction error probability level corresponding to each transaction error rate in the third training data to obtain the processed third training data; and using the processed third training data to train the random forest model to obtain the second prediction model.
[0009] Optionally, before respectively inputting the data to be predicted into the first prediction model and the second prediction model, the method further includes: performing standardization processing on the data to be predicted to obtain the standardized data to be predicted.
[0010] Optionally, after inputting the data to be predicted into the first prediction model and the second prediction model respectively to obtain the risk prediction results, the method also includes: generating early warning prompt information based on the risk prediction results, wherein the early warning prompt information is used to inform business personnel of the risk prediction results; and generating a risk handling plan based on the risk prediction results, wherein the risk handling plan is a decision-making recommendation plan for resolving transaction errors.
[0011] According to another aspect of the present application, a risk prediction device for erroneous transactions is provided, comprising: an acquisition unit, used to acquire first training data and second training data, wherein the first training data includes a first preset characteristic value and a transaction error amount, and the second training data includes a second preset characteristic value and a transaction error rate; a training unit, used to train an LSTM model using the first training data to obtain a first prediction model, and to train a random forest model using the second training data to obtain a second prediction model; an input unit, used to acquire data to be predicted, and input the data to be predicted into the first prediction model and the second prediction model respectively to obtain a risk prediction result, wherein the prediction result includes the total business prediction error number and the number of each business prediction error in a preset time period predicted by the first prediction model, and the error occurrence probability level of the preset time period predicted by the second prediction model.
[0012] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the risk prediction methods for erroneous transactions.
[0013] According to another aspect of the present application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include a risk prediction method for executing any one of the erroneous transactions.
[0014] Apply the technical solution of the present application, obtain the first training data and the second training data, wherein the first training data includes the first preset characteristic value and the transaction error amount, and the second training data includes the second preset characteristic value and the transaction error rate; use the first training data to train the LSTM model to obtain the first prediction model, and use the second training data to train the random forest model to obtain the second prediction model; obtain the data to be predicted, input the data to be predicted into the first prediction model and the second prediction model respectively, and obtain the risk prediction result, wherein the prediction result includes the total business prediction error number and the number of each business prediction error in the preset time period predicted by the first prediction model, and the transaction error probability level in the preset time period predicted by the second prediction model. By using the LSTM model to predict the transaction error amount and the random forest model to predict the error risk level of the transaction, the problem that the existing technology cannot accurately predict the transaction error amount and the error risk level is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0016] Figure 1 A hardware structure block diagram of a mobile terminal for executing a risk prediction method for error transactions provided in an embodiment of the present application is shown;
[0017] Figure 2 A schematic diagram of a process of predicting risk of an error transaction provided according to an embodiment of the present application is shown;
[0018] Figure 3 A structural diagram of a risk prediction device for a specific error transaction provided in accordance with an embodiment of the present application is shown;
[0019] Figure 4 The following is a flowchart of the error prediction model construction and prediction process provided according to the embodiment of the present application;
[0020] Figure 5 The following is a flowchart showing the construction of a transaction error risk prediction model and prediction flow according to an embodiment of the present application;
[0021] Figure 6 A structural block diagram of a risk prediction device for error transactions provided according to an embodiment of the present application is shown.
[0022] The above drawings include the following reference numerals:
[0023] 102, processor; 104, memory; 106, transmission device; 108, input and output devices. DETAILED DESCRIPTION
[0024] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:
[0028] Error adjustment: Adjust the inconsistent system status in the transaction chain after the transaction occurs.
[0029] Machine Learning: Aims to make computers learn and act like humans. By feeding computers data and information in the form of observation and interaction with the real world, the computer's learning ability is improved over time in an autonomous manner.
[0030] As introduced in the background technology, the existing technology cannot accurately predict the amount of transaction errors and the degree of error risk. In order to solve the problem that the existing technology cannot accurately predict the amount of transaction errors and the degree of error risk, the embodiments of the present application provide a risk prediction method, device, computer-readable storage medium and electronic device for error transactions.
[0031] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0032] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal for predicting the risk of error transactions according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0033] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the risk prediction method of error transactions in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0034] In this embodiment, a method for predicting the risk of erroneous transactions running on a mobile terminal, a computer terminal or a similar computing device is provided. It should be noted that the steps shown in the flowchart of 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 can be executed in an order different from that shown here.
[0035] Figure 2 1 is a flow chart of a method for predicting risk of error transactions according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0036] Step S201, obtaining first training data and second training data, wherein the first training data includes a first preset characteristic value and a transaction error amount, and the second training data includes a second preset characteristic value and a transaction error rate;
[0037] Specifically, the first preset characteristic value includes the month to which the data belongs, the day to which the data belongs, the week to which the data belongs, whether the data is a holiday, whether the system has been upgraded the day before the current data, the error amount of the day before the current data, the error amount of the two days before the current data, ..., the error amount of the seven days before the current data. The transaction error amount includes the error amount of the next day, the next two days, and the next three days of the data.
[0038] The second preset characteristic value includes the number of systems involved in the transaction data, whether the transaction data is a paired transaction, the initiating platform of the transaction data, whether the transaction data has a recovery mechanism, whether the transaction data involves account movement, whether the transaction data is an entry or a deduction, whether the transaction data involves system 1, and whether the transaction data involves system 2. The transaction error rate = the annual error volume of the transaction / the annual transaction volume of the transaction.
[0039] Step S202, using the first training data to train the LSTM model to obtain a first prediction model, and using the second training data to train the random forest model to obtain a second prediction model;
[0040] Specifically, when training an LSTM model, a back-propagation algorithm and a gradient descent optimizer are usually used to minimize the loss function to adjust the network parameters. The trained LSTM model can be used to predict future sequence data and generate new sequence data;
[0041] The random forest model is an ensemble learning method that makes predictions by combining multiple decision trees. In the random forest model, each decision tree is trained independently, and each tree is trained based on a different random sample and feature set. The final prediction result is obtained by voting or averaging the prediction results of all decision trees.
[0042] Advantages of the random forest model include:
[0043] 1. It has high accuracy and robustness, and can effectively process large amounts of data and high-dimensional features.
[0044] 2. Ability to handle missing data and imbalanced datasets.
[0045] 3. Ability to evaluate the importance of features and help understand the data set.
[0046] Step S203, obtain the data to be predicted, input the above-mentioned data to be predicted into the above-mentioned first prediction model and the above-mentioned second prediction model respectively, and obtain the risk prediction results, wherein the above-mentioned prediction results include the total business prediction error number and the number of each business prediction error in the preset time period predicted by the above-mentioned first prediction model, and the transaction error probability level in the above-mentioned preset time period predicted by the above-mentioned second prediction model.
[0047] Specifically, the risk prediction results include the total number of prediction errors for the data to be predicted, the number of prediction errors corresponding to various businesses, and the transaction error level of the data to be predicted. Based on the risk prediction results, the business personnel who handle erroneous transactions can be adjusted in a timely manner to avoid risks caused by failure to handle transaction errors in a timely manner.
[0048] Through this embodiment, the first training data and the second training data are obtained, wherein the first training data includes the first preset characteristic value and the transaction error amount, and the second training data includes the second preset characteristic value and the transaction error rate; the first training data is used to train the LSTM model to obtain the first prediction model, and the second training data is used to train the random forest model to obtain the second prediction model; the data to be predicted is obtained, and the data to be predicted is input into the first prediction model and the second prediction model respectively to obtain the risk prediction result, wherein the prediction result includes the total business prediction error number and the number of each business prediction error in the preset time period predicted by the first prediction model, and the transaction error probability level in the preset time period predicted by the second prediction model. By using the LSTM model to predict the transaction error amount and the random forest model to predict the error risk level of the transaction, the problem that the existing technology cannot accurately predict the transaction error amount and the error risk level is solved.
[0049] In the specific implementation process, the second training data is used to train the random forest model to obtain the second prediction model, including: using the Lasso model to screen the second preset feature value in the second training data to obtain the screened third training data; using the third training data to train the random forest model to obtain the second prediction model.
[0050] This method achieves feature selection by penalizing the coefficients of the Lasso model. When using the Lasso model for data screening, it is usually necessary to standardize the data first, and then use methods such as cross-validation to select the best regularization parameter. Finally, the coefficients obtained by the Lasso model can be used to determine which features have a greater impact on the target variable, thereby performing feature selection. The prediction results of the random forest model trained in this way are more accurate.
[0051] Specifically, before using the first training data to train the LSTM model, the method further includes: determining whether the first training data has eigenvalue defects, wherein the eigenvalue defects include missing eigenvalues and eigenvalue errors; before using the second training data to train the random forest model, the method further includes: determining whether the second training data has the eigenvalue defects.
[0052] Before training the model, this method must first determine whether there are missing or erroneous feature values in the training data, so as to ensure the prediction accuracy of the model after training.
[0053] More specifically, after determining whether the second training data has the above-mentioned characteristic value defect, the above-mentioned method also includes: in the case of determining that the above-mentioned second training data has the above-mentioned characteristic value defect, determining the defect type of the above-mentioned characteristic value defect of the above-mentioned second training data; according to the above-mentioned defect type, using a preset correction rule to correct the above-mentioned characteristic value defect of the above-mentioned second training data to obtain the above-mentioned second training data after correction.
[0054] This method fills in missing eigenvalues according to the properties of the eigenvalues. For example, the eigenvalue (the number of systems involved in the transaction) is filled in using the majority, the eigenvalue (the transaction initiating platform) is filled in using a set of random values from the existing data, and the eigenvalue errors are refilled using the method for filling in missing eigenvalues.
[0055] Furthermore, after using the Lasso model to screen the second preset feature value in the second training data to obtain the screened third training data, the method further includes: dividing the transaction error probability level according to the transaction error rate, and determining the transaction error probability level corresponding to each of the transaction error rates in the third training data to obtain the processed third training data; and using the processed third training data to train the random forest model to obtain the second prediction model.
[0056] This method can classify the transaction error rate and obtain the transaction error level (level 1, level 2, level 3, level 4).
[0057] Furthermore, before respectively inputting the data to be predicted into the first prediction model and the second prediction model, the method further comprises: performing standardization processing on the data to be predicted to obtain the data to be predicted after standardization processing.
[0058] This method first performs data cleaning and standardization operations on the data to be predicted, which can improve the accuracy and stability of the model prediction.
[0059] Specifically, after the above-mentioned data to be predicted are respectively input into the above-mentioned first prediction model and the above-mentioned second prediction model to obtain the risk prediction results, the above-mentioned method also includes: generating early warning prompt information based on the above-mentioned risk prediction results, wherein the above-mentioned early warning prompt information is used to inform business personnel of the above-mentioned risk prediction results; and generating a risk handling plan based on the above-mentioned risk prediction results, wherein the above-mentioned risk handling plan is a decision-making recommendation plan for resolving transaction errors.
[0060] This method generates a risk handling plan based on the risk prediction results. In this way, when the number of errors suddenly increases, error adjustment personnel can be accurately arranged according to the risk handling plan to handle the business errors that occur, avoiding the occurrence of a large number of business errors that cannot be resolved in a timely manner.
[0061] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the risk prediction method for error transactions of the present application will be described in detail below in conjunction with specific embodiments.
[0062] This embodiment provides a specific error risk prediction device, which includes predicting the error amount and predicting the probability of errors in newly connected error transactions. Through the machine learning model, the influencing factors involved are included as much as possible, and the risk of errors is comprehensively judged. Through the prediction of the error amount, the trend of the error amount in the next few days can be predicted in advance, prompting the error adjustment business personnel and related project teams to make response arrangements in advance to ensure the efficiency of error adjustment.
[0063] The specific error risk prediction device includes three modules: data acquisition and processing module, risk prediction module and organization decision prompt suggestion module, such as Figure 3 As shown:
[0064] The data acquisition module is used for data collection, data cleaning and normalization.
[0065] The risk prediction module includes three models: 1) The total error prediction model predicts the total error on day t, day t+1, and day t+2. 2) The error prediction model based on the business type. The error prediction on day t, day t+1, and day t+2 is performed for each business type. During the error adjustment process, the systems involved in the exchange must cooperate to adjust the transaction status of the system, so the related systems must also make corresponding personnel arrangements during the error adjustment. The prediction of the error amount based on the business type is convenient for the systems involved in the business line to cooperate with the arrangement of error adjustment personnel. 3) Transaction risk prediction model. The probability of error is predicted for transactions that may be subject to errors.
[0066] The organization's decision-making prompt and suggestion module provides early warning prompts and decision-making suggestions to business personnel based on the prediction results.
[0067] The total error prediction model and the error prediction model based on business type will use the multi-input and multi-output LSTM model. The error prediction model construction and prediction process flow chart are as follows: Figure 4 As shown:
[0068] Step S1: Input feature data X and target data Y, wherein the feature data (Table 1) and target data (Table 2) of the total error prediction model and the error prediction model based on the business type are as follows:
[0069] Table 1. Eigenvalues of the error prediction model
[0070]
[0071]
[0072] Table 2 Target values
[0073] Target value 1 Target value 2 Target value 2 t-day error T+1 day error T+2 day error
[0074] Step S2: Determine the legality of the data. If it is illegal, standardize the data and fill in missing values. If it is legal, perform model training.
[0075] Step S3: Train the LSTM model according to the feature data (X), target value (Y), set step size (time step), number of hidden layers and other training parameters to obtain a prediction model.
[0076] Step S4: Process the characteristic value data on day t to obtain legal input data.
[0077] Step S5: Determine the legality of the input data. If it is legal, proceed to the next step. If it is illegal, perform legalization data processing.
[0078] Step S6: Input the feature value data on day t used for prediction into the prediction model obtained in step S203 to predict the error amounts on day t, day t+1 and day t+2.
[0079] Step S7: Output the prediction results and obtain the error amounts on day t, day t+1 and day t+2.
[0080] The transaction error risk prediction model combines the Lasso algorithm and the random forest model to establish a model for prediction. Based on the Lasso-Random Forest model, on the basis of transactions that have been connected to errors, the information such as the system and transaction initiation platform involved in the transaction link is used as the feature value, and the transaction error rate is used as the observation value. A machine learning model is established to predict the probability of errors in transactions that are about to be connected to errors. Since there are many feature labels involved in the transaction, the process first uses the Lasso model to screen out features that are more related to the error rate of the transaction, that is, all the feature values involved in the transaction are first used as feature data, and the error rate of the transaction is used as the target value. The Lasso model is established, and the features with a strong correlation with the error rate are selected from the many transaction-related feature values. Then, the feature values screened by the Lasso model are used as input feature data, and the transaction error rate is used as the observation value to establish a random forest model. The process is as follows Figure 5 As shown:
[0081] Step S8: Input characteristic data X1 and target data Y1. The target value Y1 is: the transaction error rate = the annual error volume of the transaction / the annual transaction volume of the transaction. The characteristic data X1 is shown in Table 3.
[0082] Table 3
[0083] 1Eigenvalue Number of systems involved in the transaction 2 Eigenvalue Is there a pair transaction? 3 Eigenvalues Transaction initiation platform 4 Eigenvalues Is there a recovery mechanism? 5 Eigenvalues Is it related to account movement? 6 Eigenvalues Credit or debit 7 Eigenvalues Is System 1 involved? 8 Eigenvalues Is System 2 involved? ... ...
[0084] Step S9: Determine the legality of the data. If it is legal, proceed to the next step. If it is illegal, clean and standardize the data before proceeding to the next step.
[0085] Step S10: Taking all the feature values involved in the transaction as feature data and the error rate of the transaction as the target value, a Lasso model is established to screen feature values with strong correlation.
[0086] Step S11: Use the feature value screened by the Lasso model as the input feature, the target value Y is the transaction error occurrence level (1, 2, 3, 4) divided according to the transaction error rate, and establish a random forest model.
[0087] Step S12: Clean and legalize the characteristic value data involved in the transaction for which the risk of error occurrence needs to be assessed to obtain legal input data.
[0088] Step S13: Determine the legality of the data. If it is legal, proceed to the next step. If it is illegal, perform data legalization processing. Missing values are filled in according to the properties of the eigenvalues. For example, eigenvalue 1 (the number of systems involved in the transaction) is filled in with the majority, and eigenvalue 3 (the transaction initiation platform) is filled in with a set of random values in the existing data. Error values are re-filled in the same way as missing values.
[0089] Step S14: Input the feature value used for prediction into the prediction model obtained in step S11 to predict the probability level of transaction error.
[0090] Step S15: Obtain the error occurrence probability level of the possible access error transaction.
[0091] This embodiment applies the machine learning model to error risk prediction in the financial field, uses the LSTM model to predict the error amount, and uses the Lasso-random forest model to predict the error risk level of transactions. The Lasso algorithm is combined with the random forest model. The Lasso algorithm is first used to screen eigenvalues to screen out eigenvalues that are highly correlated with the probability of transaction errors. These eigenvalues are then used to train the random forest model used for prediction, thereby improving the accuracy of model prediction.
[0092] In the past, business personnel and related system personnel could not predict the amount of errors in the next few days in advance, and could only passively wait for errors to occur before responding, and could not make flexible work and personnel arrangements in advance according to the amount of errors in the next few days. This embodiment uses machine learning methods to predict the amount of errors in the next few days in advance, and can apply information that affects the amount of errors more comprehensively in the prediction process, so that the prediction results are as consistent as possible with the actual situation, and the prediction results are used in an early warning manner to prompt business personnel and related systems to make personnel arrangements and prepare emergency plans in advance.
[0093] When the business has significant development, there will be a large number of transactions connected to the error system. It is inefficient to rely solely on manual assessment to determine the risk of errors in each transaction, and the assessment process cannot fully consider the information that causes transaction errors. This embodiment uses a machine learning model to comprehensively and quickly assess the risk of transactions, prompting business personnel to focus on transactions with higher risks.
[0094] The embodiment of the present application also provides a risk prediction device for error transactions. It should be noted that the risk prediction device for error transactions in the embodiment of the present application can be used to execute the risk prediction method for error transactions provided in the embodiment of the present application. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0095] The following is an introduction to the risk prediction device for error transactions provided in an embodiment of the present application.
[0096] Figure 6 Schematic diagram of a risk prediction device for error transactions according to an embodiment of the present application. Figure 6 As shown, the device comprises:
[0097] An acquisition unit 61 is used to acquire first training data and second training data, wherein the first training data includes a first preset characteristic value and a transaction error amount, and the second training data includes a second preset characteristic value and a transaction error rate;
[0098] A training unit 62 is used to train the LSTM model using the first training data to obtain a first prediction model, and to train the random forest model using the second training data to obtain a second prediction model;
[0099] The input unit 63 is used to obtain the data to be predicted, and input the above-mentioned data to be predicted into the above-mentioned first prediction model and the above-mentioned second prediction model respectively to obtain the risk prediction results, wherein the above-mentioned prediction results include the total number of business prediction errors and the number of each business prediction error in the preset time period predicted by the above-mentioned first prediction model, and the error probability level in the above-mentioned preset time period predicted by the above-mentioned second prediction model.
[0100] In this embodiment, the acquisition unit is used to acquire the first training data and the second training data, wherein the first training data includes the first preset characteristic value and the transaction error amount, and the second training data includes the second preset characteristic value and the transaction error rate; the training unit is used to train the LSTM model with the first training data to obtain the first prediction model, and train the random forest model with the second training data to obtain the second prediction model; the input unit is used to acquire the data to be predicted, and input the data to be predicted into the first prediction model and the second prediction model respectively to obtain the risk prediction result, wherein the prediction result includes the total business prediction error number and the number of each business prediction error in the preset time period predicted by the first prediction model, and the error occurrence probability level of the preset time period predicted by the second prediction model. By using the LSTM model to predict the transaction error amount and the random forest model to predict the error risk level of the transaction, the problem that the prior art cannot accurately predict the transaction error amount and the error risk level is solved.
[0101] As an optional solution, the training unit includes a screening module and a first training module; the screening module is used to use the Lasso model to screen the above-mentioned second preset characteristic value in the above-mentioned second training data to obtain the screened third training data; the first training module is used to use the above-mentioned third training data to train the above-mentioned random forest model to obtain the above-mentioned second prediction model.
[0102] In an optional solution, the device also includes a first determination unit and a second determination unit, the first determination unit is used to determine whether the first training data has eigenvalue defects before using the first training data to train the LSTM model, wherein the eigenvalue defects include missing eigenvalues and eigenvalue errors; the second determination unit is used to determine whether the second training data has the eigenvalue defects before using the second training data to train the random forest model.
[0103] In an optional solution, the device also includes a third determination unit and a correction processing unit; the third determination unit is used to determine the defect type of the above-mentioned characteristic value defect of the above-mentioned second training data after determining whether the above-mentioned second training data has the above-mentioned characteristic value defect, if it is determined that the above-mentioned second training data has the above-mentioned characteristic value defect; the correction processing unit is used to correct the above-mentioned characteristic value defect of the above-mentioned second training data according to the above-mentioned defect type using a preset correction rule to obtain the above-mentioned second training data after correction.
[0104] In an optional solution, the training unit also includes a determination module and a second training module; the determination module is used to screen and process the second preset feature value in the second training data using the Lasso model to obtain the screened third training data, and then divide the transaction error probability level according to the transaction error rate, and determine the transaction error probability level corresponding to each of the transaction error rates in the third training data to obtain the processed third training data; the second training module is used to train the random forest model using the processed third training data to obtain the second prediction model.
[0105] In an optional solution, the device further includes a standardization processing unit, which is used to perform standardization processing on the above-mentioned data to be predicted before inputting the above-mentioned data to be predicted into the above-mentioned first prediction model and the above-mentioned second prediction model respectively, so as to obtain the above-mentioned data to be predicted after the standardization processing.
[0106] An optional solution, the device also includes a first generating unit and a second generating unit; the first generating unit is used to generate early warning information based on the risk prediction results after inputting the above-mentioned data to be predicted into the above-mentioned first prediction model and the above-mentioned second prediction model respectively to obtain the risk prediction results, wherein the above-mentioned early warning information is used to inform business personnel of the above-mentioned risk prediction results; the second generating unit is used to generate a risk handling plan based on the above-mentioned risk prediction results, wherein the above-mentioned risk handling plan is a decision-making recommendation plan for resolving transaction errors.
[0107] The risk prediction device for error transactions includes a processor and a memory. The acquisition unit, training unit, input unit, etc. are stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions. The modules are all located in the same processor; or, the modules are located in different processors in any combination.
[0108] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the problem that the existing technology cannot accurately predict the amount of transaction errors and the degree of error risk can be solved by adjusting the kernel parameters.
[0109] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0110] An embodiment of the present invention provides a computer-readable storage medium, which includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the risk prediction method for erroneous transactions.
[0111] Specifically, the risk prediction methods for error transactions include:
[0112] Step S201, obtaining first training data and second training data, wherein the first training data includes a first preset characteristic value and a transaction error amount, and the second training data includes a second preset characteristic value and a transaction error rate;
[0113] Step S202, using the first training data to train the LSTM model to obtain a first prediction model, and using the second training data to train the random forest model to obtain a second prediction model;
[0114] Step S203, obtain the data to be predicted, input the above-mentioned data to be predicted into the above-mentioned first prediction model and the above-mentioned second prediction model respectively, and obtain the risk prediction results, wherein the above-mentioned prediction results include the total business prediction error number and the number of each business prediction error in the preset time period predicted by the above-mentioned first prediction model, and the transaction error probability level in the above-mentioned preset time period predicted by the above-mentioned second prediction model.
[0115] An embodiment of the present invention provides a processor, which is used to run a program, wherein the risk prediction method for erroneous transactions is executed when the program is running.
[0116] Specifically, the risk prediction methods for error transactions include:
[0117] Step S201, obtaining first training data and second training data, wherein the first training data includes a first preset characteristic value and a transaction error amount, and the second training data includes a second preset characteristic value and a transaction error rate;
[0118] Step S202, using the first training data to train the LSTM model to obtain a first prediction model, and using the second training data to train the random forest model to obtain a second prediction model;
[0119] Step S203, obtain the data to be predicted, input the above-mentioned data to be predicted into the above-mentioned first prediction model and the above-mentioned second prediction model respectively, and obtain the risk prediction results, wherein the above-mentioned prediction results include the total business prediction error number and the number of each business prediction error in the preset time period predicted by the above-mentioned first prediction model, and the transaction error probability level in the above-mentioned preset time period predicted by the above-mentioned second prediction model.
[0120] An embodiment of the present invention provides an electronic device, the device comprising a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, at least the following steps are implemented:
[0121] Step S201, obtaining first training data and second training data, wherein the first training data includes a first preset characteristic value and a transaction error amount, and the second training data includes a second preset characteristic value and a transaction error rate;
[0122] Step S202, using the first training data to train the LSTM model to obtain a first prediction model, and using the second training data to train the random forest model to obtain a second prediction model;
[0123] Step S203, obtain the data to be predicted, input the above-mentioned data to be predicted into the above-mentioned first prediction model and the above-mentioned second prediction model respectively, and obtain the risk prediction results, wherein the above-mentioned prediction results include the total business prediction error number and the number of each business prediction error in the preset time period predicted by the above-mentioned first prediction model, and the transaction error probability level in the above-mentioned preset time period predicted by the above-mentioned second prediction model.
[0124] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0125] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing at least the following method steps:
[0126] Step S201, obtaining first training data and second training data, wherein the first training data includes a first preset characteristic value and a transaction error amount, and the second training data includes a second preset characteristic value and a transaction error rate;
[0127] Step S202, using the first training data to train the LSTM model to obtain a first prediction model, and using the second training data to train the random forest model to obtain a second prediction model;
[0128] Step S203, obtain the data to be predicted, input the above-mentioned data to be predicted into the above-mentioned first prediction model and the above-mentioned second prediction model respectively, and obtain the risk prediction results, wherein the above-mentioned prediction results include the total business prediction error number and the number of each business prediction error in the preset time period predicted by the above-mentioned first prediction model, and the transaction error probability level in the above-mentioned preset time period predicted by the above-mentioned second prediction model.
[0129] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0130] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0131] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0132] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0133] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0134] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0135] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0136] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0137] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0138] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
[0139] 1) A risk prediction method for error transactions of the present application includes: obtaining first training data and second training data, wherein the first training data includes a first preset characteristic value and a transaction error amount, and the second training data includes a second preset characteristic value and a transaction error rate; using the first training data to train an LSTM model to obtain a first prediction model, and using the second training data to train a random forest model to obtain a second prediction model; obtaining data to be predicted, and inputting the data to be predicted into the first prediction model and the second prediction model respectively to obtain a risk prediction result, wherein the prediction result includes the total business prediction error number and the number of each business prediction error in a preset time period predicted by the first prediction model, and the transaction error probability level in a preset time period predicted by the second prediction model. By using the LSTM model to predict the transaction error amount and the random forest model to predict the error risk level of the transaction, the problem that the prior art cannot accurately predict the transaction error amount and the error risk level is solved.
[0140] 2) A risk prediction device for error transactions of the present application includes: an acquisition unit for acquiring first training data and second training data, wherein the first training data includes a first preset characteristic value and a transaction error amount, and the second training data includes a second preset characteristic value and a transaction error rate; a training unit for training an LSTM model using the first training data to obtain a first prediction model, and training a random forest model using the second training data to obtain a second prediction model; an input unit for acquiring data to be predicted, and inputting the data to be predicted into the first prediction model and the second prediction model respectively to obtain a risk prediction result, wherein the prediction result includes the total business prediction error number and the number of each business prediction error in a preset time period predicted by the first prediction model, and the error occurrence probability level in a preset time period predicted by the second prediction model. By using the LSTM model to predict the transaction error amount and the random forest model to predict the error risk level of the transaction, the problem that the prior art cannot accurately predict the transaction error amount and the error risk level is solved.
[0141] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A risk prediction method for error transactions, characterized in that: include: Acquire first training data and second training data, wherein the first training data includes a first preset characteristic value and a transaction error amount, and the second training data includes a second preset characteristic value and a transaction error rate; The first training data is used to train the LSTM model to obtain a first prediction model, and the second training data is used to train the random forest model to obtain a second prediction model; Obtain the data to be predicted, input the data to be predicted into the first prediction model and the second prediction model respectively, and obtain the risk prediction results, wherein the prediction results include the total number of business prediction errors and the number of each business prediction error in the preset time period predicted by the first prediction model, and the transaction error probability level in the preset time period predicted by the second prediction model.
2. The method according to claim 1, characterized in that The second training data is used to train the random forest model to obtain a second prediction model, including: Using a Lasso model to perform screening processing on the second preset characteristic value in the second training data to obtain screened third training data; The random forest model is trained using the third training data to obtain the second prediction model.
3. The method according to claim 1, characterized in that Before using the first training data to train the LSTM model, the method further includes: Determine whether the first training data has an eigenvalue defect, wherein the eigenvalue defect includes missing eigenvalues and eigenvalue errors; Before using the second training data to train the random forest model, the method further includes: Determine whether the second training data has the feature value defect.
4. The method according to claim 3, characterized in that After determining whether the second training data has the feature value defect, the method further includes: In the case where it is determined that the second training data has the characteristic value defect, determining a defect type of the characteristic value defect of the second training data; According to the defect type, a preset correction rule is used to correct the characteristic value defect of the second training data to obtain the corrected second training data.
5. The method according to claim 2, characterized in that: After the second preset characteristic value in the second training data is screened by using the Lasso model to obtain the screened third training data, the method further includes: dividing the transaction error probability levels according to the transaction error rates, and determining the transaction error probability levels corresponding to the transaction error rates in the third training data, to obtain the processed third training data; The processed third training data is used to train the random forest model to obtain the second prediction model.
6. The method according to claim 1, characterized in that Before inputting the to-be-predicted data into the first prediction model and the second prediction model respectively, the method further includes: The data to be predicted is standardized to obtain the data to be predicted after the standardized processing.
7. The method according to any one of claims 1 to 6, characterized in that After the data to be predicted is input into the first prediction model and the second prediction model respectively to obtain a risk prediction result, the method further includes: Generate warning prompt information according to the risk prediction result, wherein the warning prompt information is used to inform business personnel of the risk prediction result; A risk handling solution is generated based on the risk prediction results, wherein the risk handling solution is a decision-making recommendation solution for resolving transaction errors.
8. A risk prediction device for error transactions, characterized in that: include: An acquisition unit, configured to acquire first training data and second training data, wherein the first training data includes a first preset characteristic value and a transaction error amount, and the second training data includes a second preset characteristic value and a transaction error rate; A training unit, configured to train the LSTM model using the first training data to obtain a first prediction model, and to train the random forest model using the second training data to obtain a second prediction model; An input unit is used to obtain data to be predicted, and input the data to be predicted into the first prediction model and the second prediction model respectively to obtain risk prediction results, wherein the prediction results include the total number of business prediction errors and the number of errors in each business prediction for a preset time period predicted by the first prediction model, and the error probability level for the preset time period predicted by the second prediction model.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the risk prediction method for error transactions according to any one of claims 1 to 7.
10. An electronic device, characterized in that: include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include a method for predicting risk of error transactions as described in any one of claims 1 to 7.