Disclosure of Invention
Based on the method and the device, the invention provides a strategy generation and risk control method and device.
According to a first aspect of the embodiments of the present invention, there is provided a policy generation method, including: selecting at least one target wind control rule from a plurality of pre-generated wind control rules, and generating a wind control strategy according to the target wind control rule; and if the target variable does not meet the preset constraint condition, adjusting the target wind control rule in the wind control strategy, wherein the target variable is an output variable obtained after a training sample is input into the wind control strategy.
Optionally, the plurality of wind control rules are generated by a plurality of decision trees, and each decision tree generates at least one of the wind control rules.
Optionally, before generating the wind control policy according to the target wind control rule, the method further includes: and merging the same target wind control rules in each decision tree.
Optionally, after merging the same target wind control rules in each decision tree, the method further includes: and if the target wind control rule has different decision conditions in each decision tree, selecting one of the decision conditions as the decision condition of the target wind control rule after combination according to the constraint conditions.
Optionally, the step of adjusting the target wind control rule in the wind control policy includes: rejecting at least one target wind control rule in the wind control strategy; and/or adjusting a decision condition of at least one target wind control rule in the wind control strategy; and/or replacing at least one target wind control rule in the wind control strategy by adopting the wind control rule.
Optionally, the method further comprises: and verifying whether the adjusted wind control strategy meets the constraint condition or not according to the test sample.
Optionally, the method further comprises: extracting training samples from a database; and generating the wind control rule according to the training sample.
Optionally, the method further comprises: updating the training samples.
Optionally, before generating the wind control rules according to the training samples, the method further comprises: and performing data cleaning and feature derivation on the training sample.
Optionally, the method further comprises: acquiring a plurality of wind control strategies meeting preset constraint conditions; and selecting an optimal wind control strategy from the plurality of wind control strategies.
Optionally, the constraint is an accuracy constraint.
According to a second aspect of embodiments of the present invention, there is provided a risk control method, the method comprising: judging whether the business data has risks according to a wind control strategy; the wind control strategy is generated by a wind control strategy generation method of any embodiment.
According to a third aspect of the embodiments of the present invention, there is provided a wind control policy generation apparatus, including: the strategy generation module is used for selecting at least one target wind control rule from a plurality of pre-generated wind control rules and generating a wind control strategy according to the target wind control rule; and the strategy adjusting module is used for adjusting a target wind control rule in the wind control strategy if a target variable does not meet a preset constraint condition, wherein the target variable is an output variable obtained after a training sample is input into the wind control strategy.
Optionally, the plurality of wind control rules are generated by a plurality of decision trees, and each decision tree generates at least one of the wind control rules.
Optionally, the apparatus further comprises: and the merging module is used for merging the same target wind control rules in each decision tree.
Optionally, the apparatus further comprises: and the threshold selection module is used for selecting one decision condition as the decision condition of the merged target wind control rule according to the constraint condition if the target wind control rule has different decision conditions in each decision tree.
Optionally, the policy adjustment module includes: the removing unit is used for removing at least one target wind control rule in the wind control strategy; and/or an adjusting unit, configured to adjust a decision condition of at least one target wind control rule in the wind control policy; and/or a replacing unit, configured to replace at least one target wind control rule in the wind control policy with the wind control rule.
Optionally, the apparatus further comprises: and the verification module is used for verifying whether the adjusted wind control strategy meets the constraint condition or not according to the test sample.
Optionally, the apparatus further comprises: the extraction module is used for extracting training samples from a database; and the wind control rule generating module is used for generating the wind control rule according to the training sample.
Optionally, the apparatus further comprises: and the updating module is used for updating the training samples.
Optionally, the apparatus further comprises: and the preprocessing module is used for carrying out data cleaning and feature derivation on the training sample.
Optionally, the apparatus further comprises: the acquiring module is used for acquiring a plurality of wind control strategies meeting preset constraint conditions; and the strategy selection module is used for selecting the optimal wind control strategy from the plurality of wind control strategies.
Optionally, the constraint is an accuracy constraint.
According to a fourth aspect of embodiments of the present invention, there is provided a risk control device, the device comprising: the judging module is used for judging whether the business data has risks according to the wind control strategy; the wind control strategy is generated by a wind control strategy generation method of any embodiment.
According to a fifth aspect of embodiments of the present invention, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of any of the embodiments.
According to a sixth aspect of embodiments of the present invention, there is provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of the embodiments when executing the program.
By applying the scheme of the embodiment of the invention, the target wind control rule in the wind control strategy is adjusted by setting the constraint condition, and the automatic selection and combination of the rules are realized, so that the wind control strategy can be automatically optimized, and the reliability of the wind control strategy is improved; meanwhile, the wind control strategy generation method does not need manual interference, and the timeliness of generating the wind control strategy is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present invention. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
Fig. 1 is a schematic diagram of a risk fighting process in one embodiment of the present description. Various risks exist in daily life, and the risks can bring certain hidden dangers. For example, when a user performs a payment operation on an electronic device 102 such as a computer, a mobile phone, or a tablet computer, a risk such as a system vulnerability may exist, which may cause a hidden danger to the asset security of the user. In order to perform risk control and guarantee asset security of the user, the bottom layer data of the user can be extracted through the network, and the extracted bottom layer data is stored in the database 104. The server 106 may collect training samples from the database 104 and generate a wind control strategy according to a certain algorithm, and the generated wind control strategy may be used for risk fighting. Of course, due to the existence of the wind control strategy, the generated risk is also upgraded correspondingly with the lapse of time and the progress of the technology, so in the process of risk countermeasure, the wind control strategy is also required to be updated along with the upgrade of the risk. Thus, a closed loop risk countermeasure is formed.
Fig. 2 is a flowchart of a method for generating a wind control policy in an embodiment of this specification. The wind control strategy generation method can comprise the following steps:
step 202: selecting at least one target wind control rule from a plurality of pre-generated wind control rules, and generating a wind control strategy according to the target wind control rule;
step 204: and if the target variable does not meet the preset constraint condition, adjusting the target wind control rule in the wind control strategy, wherein the target variable is an output variable obtained after a training sample is input into the wind control strategy.
In step 202, a plurality of wind control rules may be generated in advance according to a certain algorithm or certain algorithms, wherein different wind control rules may be generated by the same algorithm or different algorithms. For example, the plurality of wind control rules may be generated by a decision tree algorithm. The plurality of wind control rules may be wind control rules generated from the same decision tree. The plurality of wind control rules may also be generated by a plurality of decision trees, and each decision tree generates at least one of the wind control rules. For example, assuming that there are 3 decision trees, decision tree 1 may generate wind control rule A, B, C, decision tree 2 may generate wind control rules D and E, and decision tree 3 may generate wind control rules F and G, and the wind control rules obtained in step 202 include wind control rules a to G.
As shown in fig. 3, an embodiment of generating 2 decision trees is shown. Each rule is composed of a father node, a child node and a branch (i.e., a decision condition), and each finally generated leaf node corresponds to a label. It can be seen that in the embodiment shown in fig. 3, there are partially identical rules in decision tree 1 and decision tree 2. Of course, this is just one possible scenario, and in practice, the rules in each decision tree generated may be different.
After the wind control rules are obtained, at least one target wind control rule can be selected from a plurality of pre-generated wind control rules, and then a wind control strategy is generated in an iterative mode.
In step 204, the target variable is a variable obtained by importing the service data into the wind control policy, and may be used to characterize a category to which the service data belongs. A plurality of groups of training samples can be obtained from a database, the training samples are led into a wind control strategy to obtain target variables, and then whether the target variables corresponding to the training samples are consistent with the actual categories of the training samples or not is judged to verify the constraint conditions.
In the embodiment of the specification, the target wind control rules in the wind control strategy are adjusted by setting constraint conditions, and automatic selection and combination of the rules are realized, so that the wind control strategy can be automatically optimized, and the reliability of the wind control strategy is improved; meanwhile, the wind control strategy generation method does not need manual interference, and the timeliness of generating the wind control strategy is improved.
In one embodiment, training samples in a database may be extracted and the wind control rules generated from the training samples. Training samples may be obtained from the client. For example, for the pay bank service, user information uploaded by the client when the user registers, service data sent by the client when the user uses the pay bank to pay, and the like can be acquired. The generated rules can be added into a rule set, and then at least one target wind control rule is selected from the rule set to be used for generating the wind control strategy.
Before generating the wind control rules, data cleaning and feature derivation can also be performed on the training samples. Among them, data cleansing is a process of re-examining and verifying data, aiming at deleting duplicate information, correcting existing errors, and providing data consistency. Feature derivation is the creation of new meaningful features by some combination of existing features.
For the situation that the same wind control rule exists, in order to reduce redundancy of the rule, the same target wind control rule may be merged before the wind control strategy is generated according to the target wind control rule. Further, if the same target wind control rule has different decision conditions in each decision tree, one of the decision conditions may be selected as the decision condition of the target wind control rule after combination according to the constraint condition.
In one embodiment, the step of adjusting the target wind control rule in the wind control strategy comprises at least any one of: rejecting at least one target wind control rule in the wind control strategy; and/or adjusting a decision condition of at least one target wind control rule in the wind control strategy; and/or replacing at least one target wind control rule in the wind control strategy by adopting the wind control rule.
For example, the pre-generated wind control rules include { A, B, C, D, E, F, G }, and the selected target wind control rule is A, B, C. It may be determined A, B, C whether the wind control policy satisfies the constraint condition, and if not, one or more target wind control rules may be deleted from the wind control policy, for example, a is deleted, and the adjusted wind control policy includes only B and C. The decision condition of one or more target wind control rules may also be adjusted, for example, the decision condition of B is adjusted from "greater than or equal to 90" to "greater than or equal to 95". Any of the wind control rules of D, E, F, G may also be used in place of one of the target wind control rules (e.g., C). Of course, deletion, adjustment of decision conditions, and replacement may also be performed simultaneously.
In one embodiment, when the wind control strategies are obtained, a plurality of wind control strategies meeting preset constraint conditions can be obtained, and then an optimal wind control strategy is selected from the plurality of wind control strategies. For example, assuming that the acquired wind control policies meeting the constraint conditions include a policy X1, a policy X2, and a policy X3 after the target wind control rules are adjusted, an optimal wind control policy may be selected from X1, X2, and X3 as a final wind control policy. Wherein the optimum may be the most compliant with the constraints. For example, when the constraint is an accuracy constraint, the wind control strategy with the highest accuracy may be selected from X1, X2, and X3 as the final wind control strategy. Therefore, a better wind control strategy can be further obtained through secondary screening.
After the wind control strategy is obtained, whether the adjusted wind control strategy meets the constraint condition can be verified according to the test sample. The test samples may be extracted from the most recent traffic data. For example, 20% of the service data in the service data may be obtained as a test sample, and it is verified whether the finally obtained wind control policy satisfies the constraint condition. If the data meets the requirements, the wind control strategy can be directly adopted to carry out risk control on the data of the whole service system; if not, the wind control strategy can be regenerated. In this way, the impact on the overall business system is reduced.
In one embodiment, the training samples may also be updated. In the process of risk countermeasure by adopting the wind control strategy, the risk is upgraded according to the improvement of the wind control strategy, and new business data can be generated under the action of the upgraded risk, so that the training sample can be updated according to the new business data. The updating mode may be periodic updating, for example, the extraction of the underlying data is performed once every week or a month, and the training samples are updated according to the extracted underlying data. Data updating can also be performed in a condition-triggered manner.
The constraint condition in any of the above embodiments may be an accuracy constraint condition, that is, the proportion of the number of training samples with the target variable consistent with the actual class obtained by the wind control strategy to the total number of training samples. Assuming that there are N training samples in total, and M target variables among the target variables obtained through the wind control strategy are consistent with the actual categories of the corresponding training samples, the accuracy rate can be recorded as M/N. If the accuracy is greater than a preset accuracy threshold, the accuracy constraint condition can be considered to be met; otherwise, the accuracy constraint condition is not satisfied.
The constraint in any of the above embodiments may also be a risk coverage constraint, i.e. the proportion of the risk identified by the wind control strategy to the total number of risks actually present. Assuming that N training samples have risks, the number of the training samples with risks identified by the wind control strategy is M, and the risk coverage rate can be recorded as M/N. If the risk coverage rate is greater than a preset risk coverage rate threshold value, the risk coverage rate constraint condition can be considered to be met; otherwise, the risk coverage constraint is deemed not to be satisfied.
The embodiment of the specification has the following advantages:
(1) and manual rule selection is not needed, and the timeliness of strategy generation is improved.
(2) And reasonable evaluation is carried out on the rules by setting constraint conditions, so that the reliability of the rules and the strategies is improved.
(3) The strategy is generated based on the rules in the decision trees, and the robustness of the generated strategy is improved.
(4) Different rules are combined, screened and sorted, so that the redundancy of the rules is reduced.
As shown in fig. 4, embodiments of the present specification further provide a risk control method, which may include:
judging whether the business data has risks according to a wind control strategy; the wind control strategy is generated by the wind control strategy generation method of any one of the embodiments.
In this embodiment, the service data is imported into the wind control policy, and the category of the service data may be obtained, for example: a risk free category, a risk present category, a high risk present category, etc. By the method, risk control can be performed, and the safety of the service data can be guaranteed.
As shown in fig. 5, which is a general flowchart of the generation of the wind control policy and the risk control in one embodiment of the present disclosure, the method may include the following steps:
step 502: and extracting bottom-layer data. The underlying data can be from electronic devices such as a mobile phone, a computer and a tablet computer used by a user.
Step 504: data cleansing and feature derivation.
Step 506: and storing the data obtained in the step 504 into a database for later use.
Step 508: defining target variables, such as: there is a risk.
Step 510: and acquiring a training sample from the database, and executing a stump algorithm to obtain a wind control rule.
Step 512: and generating a wind control strategy according to the wind control rule, wherein the generation mode can adopt the wind control strategy generation method in any embodiment.
Step 514: and (4) testing the wind control rule generated in the step 512 by adopting the test sample, and confronting the risk according to the wind control rule after the test is finished.
Corresponding to the embodiments of the method, the invention also provides embodiments of a device, a computing storage medium and a computer device.
Fig. 6 is a block diagram of a wind control policy generation apparatus in an embodiment of the present specification. The device comprises:
the policy generation module 602 is configured to select at least one target wind control rule from a plurality of pre-generated wind control rules, and generate a wind control policy according to the target wind control rule;
and a policy adjusting module 604, configured to adjust a target wind control rule in the wind control policy if a target variable does not meet a preset constraint condition, where the target variable is an output variable obtained after a training sample is input into the wind control policy.
The specific details of the implementation process of the functions and actions of each module in the device are found in the implementation process of the corresponding step in the wind control policy generation method, and are not described herein again.
Fig. 7 is a block diagram of a risk control device according to an embodiment of the present disclosure. The device comprises:
a judging module 702, configured to judge whether the service data has a risk according to the wind control policy; the wind control strategy is generated by a wind control strategy generation method of any embodiment.
The specific details of the implementation process of the functions and actions of each module in the device are found in the implementation process of the corresponding step in the risk control method, and are not described herein again.
The data processing device in the online payment process of the present specification can be applied to a computer device, such as a server or a terminal device. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and as a logical device, the device is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for operation through the processor in which the file processing is located. From a hardware aspect, as shown in fig. 8, the hardware structure diagram is a hardware structure diagram of a computer device in which a data processing apparatus is located in an online payment process in this specification, except for the processor 802, the memory 804, the network interface 806, and the nonvolatile memory 808 shown in fig. 8, a server or an electronic device in which the apparatus is located in an embodiment may also include other hardware according to an actual function of the computer device, which is not described again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, wherein the modules described as separate parts may or may not be physically separate, and the parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution in the specification. One of ordinary skill in the art can understand and implement it without inventive effort.
Accordingly, the embodiments of the present specification also provide a computer storage medium, in which a program is stored, and the program, when executed by a processor, implements the method in any of the above embodiments.
Accordingly, the embodiments of the present specification also provide a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the program, the method in any of the above embodiments is implemented.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
The above description is only exemplary of the present disclosure and should not be taken as limiting the disclosure, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.