Training method, payment route selection method, system, electronic device and medium
Through the payment model training method and random forest algorithm, the optimal payment channel is dynamically selected, which solves the problems of high payment cost, high risk and heavy manual maintenance workload in the existing technology, and achieves the effect of reducing costs and risks.
Patent Information
- Application Number
- CN202311673502.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-07
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2043-12-07
AI Technical Summary
Existing technology makes it difficult to dynamically select payment routes, resulting in high payment costs and risks, as well as heavy manual maintenance workload.
The payment model training method is used to form a sample data set by obtaining historical data of each available payment channel, and a random forest algorithm is used to build a decision tree model to dynamically select the optimal payment channel.
It reduces payment costs and risks, reduces manual maintenance workload, and ensures optimal decision making.
Smart Images

Figure CN117875969B
Abstract
Description
Technical Field
[0001] The present application belongs to the field of science and technology finance technology, and relates to a training method, and in particular to a training method, a payment routing selection method, a system, an electronic device and a medium. Background Art
[0002] Salary payment is the core link of employment. Since payment occurs very frequently, while improving the success rate of payment to employees or service providers, reducing payment costs and payment risks has become one of the focuses of employment companies. However, in actual business scenarios, it is often difficult to achieve high success rate, low payment cost and low risk at the same time. In this case, it is necessary to set the priority of different payment channels, which is payment routing.
[0003] In the payment decision-making process, choices are usually made based on a series of rigid rules, including but not limited to static factors such as payment cost, business preference, channel acceptance capacity, and dynamic factors such as payment success rate and payment risk. By judging these rules individually or in parallel, we can choose the most suitable payment channel.
[0004] In the BtoC scenario of global salary payment, in order to save costs and control risks, service payment costs and payment risks are the focus of enterprises, and the weight of payment success rate will be relatively low. Therefore, in the actual business process, there is a clear preference for the choice of payment channels. At present, the priority judgment rules for payment routes rely on the configuration of payment operators. For the dynamic factor of payment risk, it is often difficult to select the optimal path in time through manual configuration. At the same time, due to the payment requirements of different countries in global salary payment, the change parameters of payment risk are more complicated. Summary of the invention
[0005] The purpose of this application is to provide a training method, a payment route selection method, a system, an electronic device and a medium, which are used to solve the problems in the prior art that the payment route cannot be dynamically selected, the payment cost and risk are high, and the manual maintenance workload is large.
[0006] In a first aspect, the present application provides a payment model training method, which includes: obtaining historical data of each available payment channel to form a sample data set; the historical data includes the payment risk, cost and success rate of each available payment channel; the sample data set includes a number of samples, each sample corresponds to a different value of the payment risk, cost and success rate of the available payment channel; based on the sample data set, a number of extractions are performed by a sampling and replacement method to obtain a number of training data sets; a Gini index comparison is performed on each of the training data sets to select the optimal feature; the selected optimal feature is the key feature indicator in the training data set; the optimal feature is branched to obtain a decision tree after the branching of each training data set; a random forest model is formed based on the decision tree of each training data set.
[0007] In an implementation of the first aspect, performing a Gini index comparison on each of the training data sets and selecting the optimal feature includes: extracting the training data set several times to obtain several training feature subsets; calculating the Gini index of each of the training feature subsets; and selecting the feature corresponding to the training feature subset with the smallest Gini index as the optimal feature.
[0008] In an implementation of the first aspect, branching is performed on the optimal feature to obtain a decision tree after branching of each training data set, including: calculating all possible splitting points of the features corresponding to each training feature subset; based on the Gini index of each training feature subset and all possible splitting points of the features corresponding to each training feature subset, selecting the splitting point corresponding to the feature with the smallest Gini index as the optimal splitting point; using the selected optimal feature and the optimal splitting point as two child nodes derived from the root node, further allocating the remaining features to the above two child nodes, implementing branching, and obtaining the decision tree after branching of each training data set.
[0009] In a second aspect, the present application provides a payment route selection method, the method comprising: receiving a payment request sent by a user, and obtaining several available payment channels; based on the random forest model trained by the payment model training method described above, selecting the optimal payment channel from the several available payment channels, and using the optimal payment channel as the target payment route; making payment according to the target payment route.
[0010] In an implementation of the second aspect, the random forest model trained based on the payment model training method described above selects the optimal payment channel from a number of available payment channels, including: inputting each of the available payment channels into the random forest model to obtain a prediction result for each of the available payment channels; and selecting the available payment channel with the largest number of occurrences as the optimal payment channel based on the prediction results.
[0011] In an implementation of the second aspect, the receiving a payment request sent by a user and obtaining a number of available payment channels includes: receiving a payment request sent by a user; obtaining a payment channel available to the user based on the payment request sent by the user and preset payment conditions; if the payment channel available to the user is a single payment channel, taking the payment channel available to the user as the optimal payment channel; otherwise, obtaining all payment channels available to the user.
[0012] In an implementation of the second aspect, the preset payment conditions include one or more of the following: filtering supported payment channels based on the country or region where the user is located; filtering supported payment channels based on the payment limit of the payment channel; wherein the payment limit screening includes a single limit and a total limit.
[0013] In a third aspect, the present application provides a payment route selection system, which includes: an acquisition module for receiving a payment request sent by a user and acquiring several available payment channels; a selection module for selecting an optimal payment channel from the several available payment channels based on a random forest model trained by the payment model training method described above, and using the optimal payment channel as a target payment route; a payment module for making payments according to the target payment route.
[0014] In a fourth aspect, the present application provides an electronic device, comprising: a memory for storing a processor executable program; a processor for executing the program so that the electronic device executes the payment model training method and the payment route selection method described above.
[0015] In a fifth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by an electronic device, implements the payment model training method and the payment route selection method described above.
[0016] As described above, the training method, payment route selection method, system, electronic device and medium described in the present application have the following beneficial effects:
[0017] 1. In the payment model training method proposed in this application, during the training process of the random forest model, since each subset of training feature data is formed by random sampling, the construction of each decision tree avoids the problem of excessive concentration of sample types. The final decision is not made through a single decision tree, but through voting by multiple decision trees, avoiding the statistical errors that may be caused by a single decision tree and ensuring the best choice.
[0018] 2. This application is based on the random forest algorithm strategy. By selecting the target payment route through the trained random forest model, it can help enterprises dynamically select payment channels for routing, reduce payment costs and risks, and reduce manual maintenance workload. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 Shown is a schematic diagram of an application scenario of the payment route selection method described in an embodiment of the present application.
[0020] Figure 2 Shown is a flow chart of the payment model training method described in an embodiment of the present application.
[0021] Figure 3 Shown is a flowchart of the optimal feature selection process described in an embodiment of the present application.
[0022] Figure 4 Shown is a flowchart of the decision tree construction process described in the embodiments of the present application.
[0023] Figure 5 Shown is a schematic diagram of the random forest model training process described in an embodiment of the present application.
[0024] Figure 6 Shown is a flow chart of the payment route selection method described in an embodiment of the present application.
[0025] Figure 7 Shown is a schematic diagram of the process of selecting the optimal payment channel based on the random forest model as described in an embodiment of the present application.
[0026] Figure 8 Shown is a schematic diagram of the process of obtaining available payment channels as described in an embodiment of the present application.
[0027] Fig. 9 Shown is a flow chart of a payment route selection method according to another embodiment of the present application.
[0028] Fig.10 Shown is a structural schematic diagram of the payment route selection system described in an embodiment of the present application.
[0029] Fig.11 Shown is a schematic diagram of the structure of an electronic device described in an embodiment of the present application.
[0030] Component number description
[0031] 100 Payment Routing System
[0032] 110 Get Module
[0033] 120 Select Module
[0034] 130 Payment Module
[0035] 200 Electronic equipment
[0036] 210 processor
[0037] 220 Memory
[0038] S1~Sn Steps DETAILED DESCRIPTION
[0039] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0040] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.
[0041] The present application provides a training method, a payment route selection method, a system, an electronic device and a medium, which solve the problems in the prior art of not being able to dynamically select payment routes, high payment costs and risks, and a large workload for manual maintenance.
[0042] like Figure 1 As shown, this embodiment provides an application scenario diagram of a payment route selection method, and the electronic device specifically includes a processor, a memory, a user interface and a network interface: the processor, the memory, the user interface and the network interface are connected through a communication bus; wherein the processor is, for example, a central processing unit (CPU); the user interface may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface may also include a standard wired interface and a wireless interface. The network interface may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory may also be a storage device independent of the aforementioned processor.
[0043] exist Figure 1 In the electronic device shown, the network interface is mainly used for data communication with the background server; the user interface is mainly used for data interaction with the user; the processor and memory in the electronic device of the present invention can be set in the electronic device, and the electronic device calls the executable program stored in the memory through the processor, and executes the payment route selection method provided in the embodiment of the present invention.
[0044] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0045] The technical solutions in the embodiments of the present application will be described in detail below in conjunction with the drawings in the embodiments of the present application.
[0046] like Figure 2 As shown, the present application provides a payment model training method, the payment model training method comprising:
[0047] Step S11, acquiring historical data of each available payment channel to form a sample data set; the historical data includes payment risk, fee and success rate of each available payment channel; the sample data set includes a plurality of samples, each sample corresponding to a different value of payment risk, fee and success rate of the available payment channel;
[0048] Step S12: extracting several times based on the sample data set by a sampling and replacement method to obtain several training data sets;
[0049] Step S13, performing a Gini index comparison on each of the training data sets to select the optimal feature; the selected optimal feature is the key feature indicator in the training data set;
[0050] Step S14, performing branch processing on the optimal features to obtain a decision tree after branch processing of each training data set;
[0051] Step S15: forming a random forest model based on the decision trees of each training data set. The random forest model is the payment model described in this application.
[0052] like Figure 3 As shown, it is a flow chart of the method for selecting the optimal features by comparing the Gini index of each training data set according to the embodiment of the present application. Figure 3 As shown, the Gini index of each training data set is compared, and the optimal features are selected including:
[0053] Step S131, extracting the training data set several times to obtain several training feature subsets;
[0054] Step S132, calculating the Gini index of each of the training feature subsets;
[0055] Step S133: Select the feature corresponding to the training feature subset with the smallest Gini index as the optimal feature.
[0056] like Figure 4 As shown, it is a flow chart of the method for performing branch processing on the optimal features to obtain a decision tree after branch processing of each training data set as described in an embodiment of the present application. Figure 4 As shown, the optimal features are branched to obtain a decision tree after branching of each training data set, including:
[0057] Step S141, calculating all possible segmentation points corresponding to the features of each training feature subset;
[0058] Step S142: based on the Gini index of each of the training feature subsets and all possible split points of the features corresponding to each of the training feature subsets, select the split point corresponding to the feature with the smallest Gini index as the optimal split point;
[0059] Step S143: Use the selected optimal feature and the optimal split point as two child nodes derived from the root node, further distribute the remaining features to the above two child nodes, implement branch processing, and obtain a decision tree after branch processing of each training data set.
[0060] Specifically, the random forest model is a model trained based on the random forest algorithm, which is an ensemble learning method that integrates the outputs of multiple decision trees to generate a single result. Figure 5 As shown, the random forest model training steps are as follows:
[0061] 1. Data acquisition: Obtain historical data on payment risks, fees, and success rates of different payment channels and combine them into a sample data set. Each sample corresponds to different values of payment risk, fees, and success rates.
[0062] 2. Creation of training feature subsets: Bootstrap sampling is used to create a new dataset by replacing the original sample dataset with a new one. The specific method is as follows:
[0063] According to the affected data dimensions, set up multiple different original data sets. The number of data sets must be less than or equal to the original data dimensions. Currently, there are three dimensions in the data: channel payment risk, channel payment fee, and channel payment success rate. Therefore, three data sets can be set.
[0064] Suppose the original data set is D, which contains n samples, D = {x1, x2, ..., xn}. The xi in the sample represents the specific values of the payment risk, payment fee, and payment success rate of a certain channel. The new data set D' generated by Bootstrap sampling is:
[0065] D={x1,x2,…,xn}
[0066] Among them, x1' is a sample randomly selected from D', i = 1, 2, ..., n; these samples have the same characteristics as the original data set D. The basic idea of Bootstrap sampling is to resample from the sample and use the resampled data to infer the population.
[0067] A total of k (k = 50) extractions are performed to obtain 50 training feature subsets: D'1, D'2, D'3, ..., D' 50 .
[0068] 3. Sample division (decision tree construction)
[0069] Since we have multiple subsets and each training feature contains multiple variables, we need to divide the samples so that there are more data belonging to the same category in the current decision tree and the prediction results are more accurate. Dividing the samples requires finding the samples with the best features in the current training feature subset. Different methods need to be selected to find the best features for different problem scenarios. For classification problems, the Gini index or information gain needs to be used for calculation; for regression problems, squared error is usually used.
[0070] Gini index (Gini impurity): indicates the probability that a randomly selected sample in a sample set is misclassified. Note: The smaller the Gini index, the smaller the probability that the selected sample in the set is misclassified, that is, the higher the purity of the set, and vice versa, the more impure the set. Information gain refers to the degree to which the uncertainty of a random variable is reduced under certain conditions. Squared error refers to the sum of the squares of the differences between each predicted value and the actual value and then taking the average. It is often used in machine learning to indicate the degree of difference between the predicted value and the actual value.
[0071] Since it is necessary to select different categories of payment channels as a classification problem, the Gini index is used as an example to select the optimal feature:
[0072] Step 1: Calculate the Gini index of the training feature subset D'. The calculation formula is:
[0073] Gini(D')=1-∑(p k ) 2
[0074] Where D' is the training feature subset, p k is the proportion of samples of the kth class in the data set D'.
[0075] It is expressed as:
[0076]
[0077]
[0078]
[0079] Step 2: For each feature A, i.e., one of the payment risk, cost, or success rate mentioned above, and each possible value a, split D' according to whether the sample point tests A = a as "yes" or "no". i and D' ii Two parts, calculate the Gini index when A=a: Gini(D',A=a)=|D' i | / |D'|*Gini(D' i )+|D' ii | / |D'|*Gini(D' ii ),
[0080] Get multiple split points for each feature with values of a1, a2, a3...ai:
[0081] (1) Gini (payment risk, A = a) = |D' i Payment risk| / |D'Payment risk|*Gini(D' i Payment risk)+|D' ii Payment risk| / |D'Payment risk|*Gini(D' ii Payment Risk)
[0082] (2) Gini (payment fee, A = a) = |D' i Pay the fee| / |D'Pay the fee|*Gini(D' i Pay the fee)+|D' ii Pay the fee| / |D'Pay the fee|*Gini(D' ii Payment Fees)
[0083] (3) Gini (payment success rate, A = a) = |D' i Payment success rate| / |D'Payment success rate|*Gini(D' i Payment success rate)+|D' ii Payment success rate| / |D'Payment success rate|*Gini(D' ii Payment success rate)
[0084] Step 3: Among all features A and all possible split points a, select the feature with the smallest Gini index and its corresponding split point as the optimal feature and optimal split point, and obtain:
[0085] (1)Min{Gini(payment risk, A=a)}
[0086] (2) Min{Gini(payment fee, A=a)}
[0087] (3)Min{Gini(payment success rate, A=a)}
[0088] Step 4: Split the training feature subset according to the optimal split point to generate two branches, assign the training feature subset to two child nodes, and repeat the above process until the number of samples in the node is less than the preset threshold.
[0089] 4. Random Decision Forest Construction
[0090] Multiple decision trees are constructed in the above repetitive manner to form a random forest. When making predictions, new input samples will be predicted by all decision trees separately, and then the category with the most occurrences will be selected as the final prediction result through voting. The calculation method is:
[0091] Y=mode{Y1,Y2,...,Yn}
[0092] Among them, Yi is the prediction result of the i-th decision tree, and mode is the operation of taking the mode.
[0093] The role of decision trees: help make choices from multiple options. The process of building a decision tree is:
[0094] A decision tree consists of multiple forks, with the top being the trunk node (or root node), which contains all current choices. At each fork node, for a certain feature, based on the value of the feature, part of the choices are divided into one fork and the other part into another fork, and one of the two forks is selected to continue the fork. The selection of features is usually based on their predictive ability for the target variable, such as information gain or Gini impurity. After passing through the fork nodes many times, once the depth requirement of the decision tree is reached, the amount of data at a node is less than a predetermined threshold, or the data purity of the node is high enough, the construction of the decision tree is completed.
[0095] In the payment model training method described in this application, during the training process of the random forest model, since each subset of training feature data is formed by random sampling, the construction of each decision tree avoids the problem of excessive concentration of sample types. The final decision is not made through a single decision tree, but through voting by multiple decision trees, avoiding the statistical errors that may be generated by a single decision tree and ensuring the best choice.
[0096] like Figure 6 As shown, an embodiment of the present application provides a payment route selection method, the payment route selection method comprising the following steps:
[0097] Step S21: receiving a payment request sent by a user and obtaining a plurality of available payment channels. Multiple available payment channels are supported for the payment request sent by the user.
[0098] Step S22: Based on the random forest model trained by the payment model training method described above, the optimal payment channel is selected from the plurality of available payment channels, and the optimal payment channel is used as the target payment route. The random forest model is a model trained based on the random forest algorithm, which is an integrated learning method that integrates the outputs of multiple decision trees to generate a single result.
[0099] Step S23: Make payment according to the target payment route.
[0100] like Figure 7 As shown, it is a flowchart of a method for selecting the optimal payment channel from a plurality of available payment channels based on the random forest model obtained by training the payment model training method described above according to an embodiment of the present application. Figure 7 As shown, the random forest model obtained by training the payment model training method described above, selecting the optimal payment channel from the plurality of available payment channels includes the following steps:
[0101] Step S221: Input each of the available payment channels into the random forest model to obtain prediction results of each of the available payment channels. The random forest model is used to predict all the available payment channels supported by the user, and each of the available payment channels is predicted by all decision trees to obtain prediction results of each of the available payment channels.
[0102] Step S222: Based on the prediction result, the available payment channel with the largest number of occurrences is selected as the optimal payment channel.
[0103] Specifically, the random forest model obtained by training based on the payment model training method described above is used to predict each of the available payment channels. Each of the available payment channels will be predicted by all decision trees respectively, and then the available payment channel with the largest number of occurrences is selected as the final prediction result by voting, that is, the available payment channel with the largest number of occurrences is selected as the optimal payment channel, and the optimal payment channel is used as the target payment route.
[0104] The decision tree construction process is demonstrated using the data of several payment channels as an example. As shown below, the data of six payment channels are displayed:
[0105] Channel A: payment rate 0.2%, payment success rate 45%, payment risk rate 1%;
[0106] Channel B: payment rate 0.6%, payment success rate 75%, payment risk rate 1%;
[0107] Channel C: payment fee rate 0.1%, payment success rate 35%, payment risk rate 3%;
[0108] Channel D: payment rate 0.4%, payment success rate 65%, payment risk rate 1.2%;
[0109] Channel E: payment fee rate 0.3%, payment success rate 55%, payment risk rate 1%;
[0110] Channel F: payment fee rate 0.5%, payment success rate 61%, payment risk rate 0.02%.
[0111] First, since there are three characteristics (payment fee, payment risk and payment success rate), the first, second and third layers of the decision tree are constructed first. Specifically:
[0112] First Tier - Payment Fees:
[0113] This is the first decision point. As a Btoc company, the first thing to consider is the payment fee. According to the level of the fee, it is divided into two branches, for example, one branch is the fee below a certain threshold (such as 5%), and the other branch is the fee above this threshold.
[0114] Second layer - payment risk:
[0115] Under each branch about fees, the next consideration is payment risk. Again, this layer is further divided into two branches based on the level of payment risk, for example, one for risk below a certain threshold (such as 50%) and the other for risk above this threshold.
[0116] Third layer - payment success rate:
[0117] The last layer considers the payment success rate. Based on the first two features, this layer will further make the final choice based on the success rate. For example, one branch may have a success rate above a certain threshold (such as 45%), and the other may be below this threshold.
[0118] The calculation of the threshold in the above text is to obtain the optimal feature and the optimal split point by taking different split point values a1, a2, a3, etc. through the feature data of the selected payment channel in the data set, and selecting the feature with the smallest Gini index and its corresponding split point.
[0119] Through the construction of the above three-layer decision tree, we recurse on each branch until we find the most suitable payment channel.
[0120] The construction of a decision forest is similar to that of a decision tree. After multiple decision trees are constructed, the final decision is selected based on the votes of the decision trees.
[0121] like Figure 8 As shown, it is a flow chart of the method for receiving a payment request sent by a user and obtaining several available payment channels as described in an embodiment of the present application. Figure 8 As shown, the receiving of the payment request sent by the user and obtaining several available payment channels includes:
[0122] Step S211: receiving a payment request sent by a user;
[0123] Step S212: based on the payment request sent by the user and the preset payment conditions, obtaining the user's available payment channels;
[0124] Step S213: If the payment channel available to the user is a single payment channel, use the payment channel available to the user as the optimal payment channel;
[0125] Step S214: Otherwise, obtain all the payment channels available to the user.
[0126] Specifically, if the country or region where the user is located supports a single available payment channel, the current user's available payment channel will be used as the optimal payment channel; if the user's country or region supports multiple payment channels, all the user's available payment channels will be obtained, and the optimal payment channel will be selected through the trained random forest model.
[0127] In one embodiment of the present application, the preset payment conditions include one or more of the following:
[0128] Filter supported payment methods based on the user's country or region;
[0129] The supported payment channels are filtered according to the payment limits of the payment channels; wherein the filtering of the payment limits includes a single limit and a total limit.
[0130] In one embodiment of the present application, when there are multiple payment channels supported by the country or region where the user is located, the payment channels supported by the payment channels are selected based on the payment limits of the payment channels, including:
[0131] According to the single payment limit of the payment channel and the payment amount of the order in the payment request, filter out the payment channels whose single payment limit is less than the payment amount;
[0132] According to the paid limit, the payment amount of the order, and the total payment limit of the payment channel, the payment channels whose remaining payment limit is less than the payment amount are filtered out.
[0133] Specifically, the user's available payment channels need to meet preset payment conditions, and the preset payment conditions are: filter supported payment channels based on the country or region where the user is located; filter supported payment channels based on the payment limits of the payment channels.
[0134] When the country or region where the user is located supports multiple payment channels; filter the payment channels based on the payment limit, which includes the single limit and the total limit. The priority is arranged from high to low, and the smaller the number after the priority, the higher the priority.
[0135] Priority 1: based on the single payment limit of the payment channel and the payment amount of the order, filter out the payment channels whose single payment limit is less than the payment amount;
[0136] Priority 2: Filter out payment channels whose remaining payment limits are less than the payment amount based on the paid limit, the payment amount of the order, and the total payment limit of the payment channel;
[0137] When there are multiple payment channels that pass the payment limit screening, the payment channel is automatically selected based on the payment conditions; the payment conditions include one or more of the following: payment cost, payment risk, payment success rate:
[0138] Choose payment channels in order from low to high based on their fees;
[0139] Select payment channels from low to high based on the payment risk of each channel;
[0140] Payment channels are selected in descending order based on their success rates.
[0141] The characteristics of the above three payment channels are generally not met at the same time, and the payment risk and payment success rate are in a dynamic process of change. Therefore, this application uses the random forest model trained by the payment model training method described above to automatically select the payment channel according to the payment conditions.
[0142] In one embodiment of the present application, Fig. 9 As shown, it is a specific flow chart of the payment route selection method described in the embodiment of the present application, which completes the routing of multiple payment channels. The following takes 6 payment channels as an example, combined with Fig. 9 Provide detailed explanation.
[0143] Channel A: payment rate 0.2%, payment success rate 45%, payment risk rate 1%;
[0144] Channel B: payment rate 0.6%, payment success rate 75%, payment risk rate 1%;
[0145] Channel C: payment fee rate 0.1%, payment success rate 35%, payment risk rate 3%;
[0146] Channel D: payment rate 0.4%, payment success rate 65%, payment risk rate 1.2%;
[0147] Channel E: payment fee rate 0.3%, payment success rate 55%, payment risk rate 1%;
[0148] Channel F: payment fee rate 0.5%, payment success rate 61%, payment risk rate 0.02%.
[0149] First, accept the payment request sent by the user and determine whether the country or region where the user is located supports multi-channel payment. If multi-channel is not supported, the only channel is the best channel, and the corresponding single channel is selected for payment.
[0150] If the country or region where the user is located supports multi-channel payment, a judgment is made based on whether the payment amount reaches the minimum payment threshold of the payment channel. If the channel that meets the conditions is unique, the unique channel is the best channel and the corresponding channel is selected for payment. If the payment channel that meets the conditions is multiple channels, proceed to the next step of judgment.
[0151] If the amount paid by the user has reached the minimum payment threshold of the payment channel, the user will be judged based on whether the amount paid by the user in the channel has reached the limit of the channel. If the limit has been reached, payment can no longer be made through the channel. If the channel that meets the conditions is the only one, the only channel is the best channel, and the corresponding channel is selected for payment; if there are multiple payment channels that meet the conditions, proceed to the next step of judgment.
[0152] If the amount paid by the user does not reach the total limit of the channel, the total payment limit of the enterprise in the channel will be used for judgment. If the enterprise's payment in the channel has reached the limit, the enterprise can no longer pay through the channel. If there is only one channel that meets the conditions, the only channel is the best channel and the corresponding channel is selected for payment; if there are multiple channels that meet the conditions, proceed to the next step of judgment.
[0153] If the amount paid by the enterprise does not reach the total limit of the channel, and there are multiple channels that meet the conditions, a random forest algorithm decision vote will be performed based on the payment fee, payment risk rate, and payment success rate of the channel. Take the six payment channels mentioned above as an example:
[0154] Channel A: payment rate 0.2%, payment success rate 45%, payment risk rate 1%;
[0155] Channel B: payment rate 0.6%, payment success rate 75%, payment risk rate 1%;
[0156] Channel C: payment fee rate 0.1%, payment success rate 35%, payment risk rate 3%;
[0157] Channel D: payment rate 0.4%, payment success rate 65%, payment risk rate 1.2%;
[0158] Channel E: payment fee rate 0.3%, payment success rate 55%, payment risk rate 1%;
[0159] Channel F: payment rate 0.5%, payment success rate 61%, payment risk rate 0.02%
[0160] In the end, 5 out of 50 decision trees chose channel A, 15 chose channel D, 30 chose channel E, and finally channel E was selected for payment.
[0161] In summary, the training method, payment route selection method, system, electronic device and medium provided in the embodiments of the present application are based on the random forest algorithm strategy. The random forest model obtained by training the payment model training method selects the target payment route, which can help enterprises dynamically select payment channels for routing, reduce payment costs and risks, and reduce manual maintenance workload. In the training process of the random forest model in this application, since each subset of training feature data is formed by random sampling, the construction of each decision tree avoids the problem of excessive concentration of sample types. The final decision-making behavior is not completed by a single decision tree, but by voting by multiple decision trees, avoiding the statistical errors that may be caused by a single decision tree and ensuring the best choice.
[0162] The protection scope of the payment route selection method described in the embodiment of the present application is not limited to the execution order of the steps listed in the present embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present application are included in the protection scope of the present application.
[0163] The embodiment of the present application also provides a payment route selection system, which can implement the payment route selection method described in the present application. However, the implementation device of the payment route selection method described in the present application includes but is not limited to the structure of the payment route selection system listed in the present embodiment. All structural deformations and replacements of the prior art made according to the principles of the present application are included in the protection scope of the present application.
[0164] like Fig.10 As shown, this embodiment provides a payment route selection system, and the payment route selection system 100 includes an acquisition module 110, a selection module 120 and a payment module 130; the acquisition module 110 is used to receive a payment request sent by a user and obtain a number of available payment channels; the selection module 120 is used to select the optimal payment channel from the several available payment channels based on the random forest model trained by the payment model training method described above, and use the optimal payment channel as the target payment route; the payment module 130 is used to make payment according to the target payment route.
[0165] In the several embodiments provided in the present application, it should be understood that the disclosed system, device or method can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules / units is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules or units, which can be electrical, mechanical or other forms.
[0166] The modules / units described as separate components may or may not be physically separated, and the components displayed as modules / units may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules / units may be selected according to actual needs to achieve the purpose of the embodiments of the present application. For example, the functional modules / units in the various embodiments of the present application may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.
[0167] Those of ordinary skill in the art should further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0168] like Fig.11 As shown, this embodiment provides an electronic device, the electronic device 200 includes a memory 210 and a processor 220; the memory 210 is used to store a program executable by the processor 220; the processor 220 is used to execute the program so that the electronic device 200 executes the above-mentioned payment model training method and the above-mentioned payment route selection method.
[0169] The present application also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by an electronic device, the payment model training method and the payment route selection method described above are implemented. A person skilled in the art can understand that all or part of the steps in the method for implementing the above embodiment can be completed by instructing the processor through a program. The program can be stored in a computer-readable storage medium, and the storage medium is a non-transitory medium, such as a random access memory, a read-only memory, a flash memory, a hard disk, a solid-state hard disk, a magnetic tape, a floppy disk, an optical disc, and any combination thereof. The above storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid-state disk (SSD)), etc.
[0170] The present application embodiment may also provide a computer program product, the computer program product including one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer or data center.
[0171] When the computer program product is executed by a computer, the computer executes the method described in the above method embodiment. The computer program product may be a software installation package, and when the above method is required, the computer program product may be downloaded and executed on a computer.
[0172] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.
[0173] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A payment model training method, characterized in that: The payment model training method comprises: Acquire historical data of each available payment channel to form a sample data set; the historical data includes payment risk, fee and success rate of each available payment channel; the sample data set includes a plurality of samples, each sample corresponding to a different value of payment risk, fee and success rate of the available payment channel; Based on the sample data set, a plurality of extractions are performed by a sampling and replacement method to obtain a plurality of training data sets; Compare the Gini indexes of the training data sets to select the optimal features; the selected optimal features are the key feature indicators in the training data sets; extract the training data sets several times to obtain several training feature subsets; calculate the Gini index of each training feature subset; select the feature corresponding to the training feature subset with the smallest Gini index as the optimal feature; The optimal feature is subjected to branch processing to obtain a decision tree after the branch processing of each training data set; all possible split points of the features corresponding to each training feature subset are calculated; based on the Gini index of each training feature subset and all possible split points of the features corresponding to each training feature subset, the split point corresponding to the feature with the smallest Gini index is selected as the optimal split point; the selected optimal feature and the optimal split point are used as two child nodes derived from the root node, and the remaining features are further allocated to the above two child nodes to implement branch processing, so as to obtain a decision tree after the branch processing of each training data set; A random forest model is formed based on the decision trees of each of the training data sets.
2. A payment route selection method, characterized in that: The method comprises: Receive payment requests from users and obtain several available payment channels; Based on the random forest model trained by the payment model training method according to claim 1, an optimal payment channel is selected from the plurality of available payment channels, and the optimal payment channel is used as the target payment route; Payment is made according to the target payment route.
3. The payment route selection method according to claim 2, characterized in that: The optimal payment channel selected from the several available payment channels based on the trained random forest model includes: Inputting each of the available payment channels into the random forest model to obtain a prediction result of each of the available payment channels; Based on the prediction result, the available payment channel with the largest number of occurrences is selected as the optimal payment channel.
4. The payment route selection method according to claim 2, characterized in that: The receiving a payment request sent by a user and obtaining a plurality of available payment channels comprises: Receive payment requests sent by users; Based on the payment request sent by the user and the preset payment conditions, obtaining the user's available payment channels; If the user has a single payment channel available, use the user's available payment channel as the optimal payment channel; Otherwise, get all the payment channels available to the user.
5. The payment route selection method according to claim 4, characterized in that: The preset payment conditions include one or more of the following: Filter supported payment methods based on the user's country or region; The supported payment channels are filtered according to the payment limits of the payment channels; wherein the filtering of the payment limits includes a single limit and a total limit.
6. A payment routing selection system, characterized in that: The payment routing selection system includes: The acquisition module is used to receive the payment request sent by the user and obtain several available payment channels; A selection module, configured to select an optimal payment channel from the plurality of available payment channels based on the random forest model trained by the payment model training method according to claim 1, and use the optimal payment channel as a target payment route; A payment module is used to make payment according to the target payment route.
7. An electronic device, characterized in that: The electronic device comprises: A memory for storing a processor executable program; A processor is used to execute the program so that the electronic device executes the payment model training method according to claim 1 and the payment route selection method according to any one of claims 2 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by an electronic device, it implements the payment model training method described in claim 1 and the payment route selection method described in any one of claims 2 to 5.
