Task execution method and device, storage medium and electronic equipment

By converting sample data and risk control strategies into vector form and manipulating them using the NumPy library, the problem of low query efficiency during the risk control strategy verification process is solved, enabling efficient risk control strategy verification and deployment.

CN119046281APending Publication Date: 2024-11-29ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410916802.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-08
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

In existing technologies, the efficiency of sample data query is low during the verification process of risk control strategies, which affects the efficiency of risk control strategy verification and deployment.

Method used

The sample data and risk control strategies to be verified are converted into vector files, and then manipulated using the NumPy library. Vector matching is used to quickly query the sample data that matches the data, thus improving query efficiency.

Benefits of technology

It significantly improves the efficiency of risk control strategy verification and deployment, reduces storage space usage, and simplifies the operation process for risk control maintenance personnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119046281A_ABST
    Figure CN119046281A_ABST
Patent Text Reader

Abstract

The invention discloses a task execution method and device, a storage medium and electronic equipment, and the task execution method provided by the invention can convert sample data required when a strategy verification task is executed into a file in a vector form, and convert a threshold value involved in a risk control strategy to be verified into a vector form. Therefore, the converted risk control strategy which can be used for representing the vector value range corresponding to the sample data hitting the to-be-verified risk control strategy is obtained, the sample data hitting the to-be-verified risk control strategy can be quickly queried in a vector matching mode, the efficiency of a strategy verification task is effectively improved, and the risk control strategy verification efficiency is improved. And the deployment efficiency of the risk control strategy is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a task execution method, device, storage medium and electronic equipment. Background Art

[0002] With the continuous development of computer technology, technologies such as artificial intelligence and big data analysis have been applied in many business scenarios to improve users' various business experiences while ensuring the security of users' personal information and privacy data.

[0003] In the process of conducting business risk control on users, it is currently necessary to regularly verify the risk control strategies adopted in the risk control process through sample data. The main purpose of verification is to verify whether the risk control threshold settings adopted in the risk control strategy are reasonable and whether it can effectively identify risky sample data.

[0004] When verifying the adjusted risk control strategy through sample data, it is necessary to query the risk sample data identified under the adjusted risk control strategy to calculate the recall rate of the risk sample data. However, the current query method is inefficient, which in turn affects the verification efficiency and deployment efficiency of the risk control strategy.

[0005] Therefore, how to effectively improve the query efficiency of sample data during risk strategy verification is a technical problem that needs to be solved urgently. Summary of the invention

[0006] This specification implements a task execution method, device, storage medium and electronic device to partially solve the problem of low query efficiency in the process of verifying risk control strategies in the prior art.

[0007] The embodiments of this specification adopt the following technical solutions:

[0008] The embodiment of this specification provides a task execution method, including:

[0009] In response to the policy verification request, determine the sample set required for executing the policy verification task and the risk control policy to be verified, and for each sample data in the sample set, the sample data is composed of a sample tag name and a tag value;

[0010] The risk control strategy to be verified is transformed through a preset mapping dictionary to obtain a transformed risk control strategy, wherein the transformed risk control strategy contains a vector value range corresponding to the sample data that hits the risk control strategy to be verified, and, for each sample data in the sample set, the vector value of the sample label name corresponding to the sample data and the vector value of the label value corresponding to the sample data are determined through a preset mapping dictionary, and the vector value of the sample label name corresponding to the sample data and the vector value of the label value corresponding to the sample data are combined to obtain a sample vector corresponding to the sample data;

[0011] A strategy verification task is performed according to the sample vector corresponding to each sample data in the sample set and the post-conversion risk control strategy.

[0012] Furthermore, in some implementations, before executing the strategy verification service according to the sample vector corresponding to each sample data in the sample set and the post-conversion risk control strategy, the method further includes:

[0013] Generate a sample vector file corresponding to the sample set according to the sample vector corresponding to each sample data in the sample set;

[0014] The sample vector file is stored in a preset library, and the preset library includes: a NumPy library.

[0015] Furthermore, in some implementations, according to the sample vector corresponding to each sample data in the sample set and the post-conversion risk control strategy, a strategy verification service is performed, specifically including:

[0016] Determine a file copy slice according to the sample vector file;

[0017] A policy verification task is performed according to the file copy slice and the post-conversion risk control strategy.

[0018] Furthermore, in some implementations, according to the sample vector corresponding to each sample data in the sample set and the post-conversion risk control strategy, a strategy verification task is performed, specifically including:

[0019] Determine and save a view corresponding to the sample vector file, where the view is used to represent metadata corresponding to the sample vector file;

[0020] A strategy verification task is performed according to the view and the post-conversion risk control strategy.

[0021] Furthermore, in some implementations, according to the view and the post-conversion risk control strategy, a strategy verification task is performed, specifically including:

[0022] According to the view, a sample vector having a sample label name required by the post-conversion risk control strategy is read from a preset storage space;

[0023] Determine the number of sample vectors that hit the vector value range corresponding to the post-conversion risk control strategy from the read sample vectors as the number of hits;

[0024] According to the hit data, a strategy verification task is performed.

[0025] Furthermore, in some implementations, according to the sample vector corresponding to each sample data in the sample set and the post-conversion risk control strategy, a strategy verification task is performed, specifically including:

[0026] Determine a query statement corresponding to the post-conversion risk control strategy according to the post-conversion risk control strategy and a preset query grammar;

[0027] According to the query statement and the sample vector corresponding to each sample data in the sample set, the sample data that hits the risk control strategy to be verified is determined, and the strategy verification task is performed according to the determined sample data that hits the risk control strategy to be verified.

[0028] The embodiment of this specification provides a task execution device, including:

[0029] A determination module, configured to determine, in response to a policy verification request, a sample set required for executing a policy verification task and a risk control policy to be verified, wherein for each sample data in the sample set, the sample data is composed of a sample tag name and a tag value;

[0030] A conversion module, used to convert the risk control strategy to be verified through a preset mapping dictionary to obtain a converted risk control strategy, wherein the converted risk control strategy contains a vector value range corresponding to the sample data that hits the risk control strategy to be verified, and, for each sample data in the sample set, determine the vector value of the sample label name corresponding to the sample data and the vector value of the label value corresponding to the sample data through a preset mapping dictionary, and combine the vector value of the sample label name corresponding to the sample data and the vector value of the label value corresponding to the sample data to obtain a sample vector corresponding to the sample data;

[0031] An execution module is used to execute a strategy verification task according to a sample vector corresponding to each sample data in the sample set and the post-conversion risk control strategy.

[0032] Furthermore, in some embodiments, the device further comprises:

[0033] A storage module is used to generate a sample vector file corresponding to the sample set according to the sample vector corresponding to each sample data in the sample set and the post-conversion risk control strategy before the execution module executes the strategy verification business; the sample vector file is stored in a preset library, and the preset library includes: a NumPy library.

[0034] Furthermore, in some implementations, the execution module is specifically used to determine a file copy slice according to the sample vector file; and execute a policy verification task according to the file copy slice and the post-conversion risk control strategy.

[0035] Furthermore, in some implementations, the execution module is specifically used to determine and save a view corresponding to the sample vector file, where the view is used to represent metadata corresponding to the sample vector file; and execute a strategy verification task based on the view and the post-conversion risk control strategy.

[0036] Furthermore, in some embodiments, the execution module is specifically used to, according to the view, read out sample vectors that meet the sample label names required by the post-conversion risk control strategy from a preset storage space; determine the number of sample vectors that hit the vector value range corresponding to the post-conversion risk control strategy from the read sample vectors as the number of hits; and execute the strategy verification task based on the hit data.

[0037] Furthermore, in some embodiments, the execution module is specifically used to determine the query statement corresponding to the post-conversion risk control strategy based on the post-conversion risk control strategy and a preset query grammar; determine the sample data that hits the risk control strategy to be verified based on the query statement and the sample vector corresponding to each sample data in the sample set, and execute the strategy verification task based on the determined sample data that hits the risk control strategy to be verified.

[0038] An embodiment of the present specification provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned task execution method is implemented.

[0039] An embodiment of the present specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned task execution method when executing the program.

[0040] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:

[0041] The task execution method provided in the embodiment of the present specification, in response to a policy verification request, determines the sample set required for executing the policy verification task and the risk control strategy to be verified, and then, through a preset mapping dictionary, transforms the risk control strategy to be verified to obtain the transformed risk control strategy, and for each sample data in the sample set, through a preset mapping dictionary, determines the vector value of the sample label name corresponding to the sample data, and determines the vector value of the label value corresponding to the sample data, and combines the vector value of the sample label name corresponding to the sample data and the vector value of the label value corresponding to the sample data to obtain the sample vector corresponding to the sample data, and finally, executes the policy verification task according to the sample vector corresponding to each sample data in the sample set and the transformed risk control strategy.

[0042] It can be seen from the above task execution method that the task execution method provided in this specification can convert the sample data required when executing the policy verification task into a vector file, and convert the thresholds involved in the risk control strategy to be verified into a vector form, thereby obtaining a converted risk control strategy that can be used to represent the vector value range corresponding to the sample data that hits the risk control strategy to be verified. Then, through vector matching, the sample data that can hit the risk control strategy to be verified can be quickly queried, thereby effectively improving the efficiency of the strategy verification task and further improving the deployment efficiency of the risk control strategy. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 A schematic diagram of a strategy tree provided for this specification;

[0044] Figure 2 A schematic diagram of the update process and deployment process of the policy tree provided for this manual;

[0045] Figure 3 A flowchart of a task execution provided in this specification;

[0046] Figure 4 A schematic diagram of a task execution device provided in this specification;

[0047] Figure 5 A method corresponding to the Figure 3 Schematic diagram of an electronic device. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.

[0049] At present, in order to ensure the business security of users, it is usually necessary to set up more complex risk control strategies. These risk control strategies can be combined to form a risk control strategy tree. The risk control thresholds corresponding to each risk control strategy are set in the strategy tree. Therefore, in the process of business risk control, it can actually be understood as identifying business risks through these risk control thresholds set in the strategy tree. The strategy tree is as follows: Figure 1 shown.

[0050] Figure 1 A schematic diagram of a strategy tree provided in this specification.

[0051] from Figure 1 It can be seen that the risk control system can obtain the business interface picture of the user during the business execution process. The business interface picture contains a recognizable QR code and a gold coin image, and the risk control system uses the thresholds set in the policy tree ( Figure 1 ”>90” in the value is the threshold value) It can be determined that the business interface image contains a gold coin image, so the branch with a gold coin score of >90 in the strategy tree is hit. Since the business interface image also contains a QR code, under this branch, the branch with a QR code score of >90 is further hit, thereby determining that the business performed by the user may involve the risk of advertising marketing.

[0052] The above is just a simple example of a policy tree. In actual applications, the policy tree may be more complex. There are many thresholds and branches for risk control in the policy tree. In order to ensure that the policy tree can effectively identify the risks when users perform business, it is necessary to adjust the policy tree regularly. In other words, it is necessary to regularly verify the risk control strategies contained in the policy tree.

[0053] During the strategy verification process, some sample data is usually needed to determine the hits of the risk identification using the strategy tree. If it is determined that it is not as good as the preset risk control expectations, it is necessary to adjust the thresholds in the strategy tree, or add additional thresholds and branches to the original strategy tree to update the original strategy tree.

[0054] Once the strategy tree is updated, the updated strategy tree needs to be verified with sample data. If it still does not meet expectations, continue to adjust until the updated strategy tree meets the preset risk control expectations, and then deploy the updated strategy tree that meets the risk control expectations. The entire strategy tree update and deployment process is as follows: Figure 2 shown.

[0055] Figure 2 A schematic diagram of the update process and deployment process of the policy tree provided for this manual.

[0056] The entire strategy tree update process can be divided into three stages: formulating the strategy tree, updating the strategy tree, and deploying the strategy tree.

[0057] After starting the strategy verification task, you can first select a sample set based on actual needs, and then start the test. During this process, you can first develop a new strategy tree based on human expert experience or the original strategy tree, and verify the new strategy tree through the selected sample set to verify the risk control capability of the new strategy tree.

[0058] During the verification process, the hits or misses of the new strategy tree for the sample data contained in the selected sample set can be counted, that is, which risky sample data can be identified by the new strategy tree and which risky sample data cannot be identified by the new strategy tree. By counting the hits or misses of the sample data, it can be determined whether the new strategy tree meets the preset risk control expectations. If so, the new strategy tree can be deployed online, and if it does not meet the preset risk control expectations, the strategy tree needs to be updated.

[0059] There are two ways to update: one is to adjust the threshold in the new strategy tree, and the other is to add thresholds and branches in the new strategy tree. Once the strategy tree is updated, the selected sample set can be used to verify it, so as to count the hits or misses of the updated strategy tree on the sample data, until the strategy tree is adjusted to meet the preset risk control expectations, and the updated strategy tree is deployed.

[0060] In this process, in order to save storage space, the sample data required to perform the policy verification task is usually stored in the Json format of <string, integer>. In this storage mode, when verifying the policy, a polling retrieval method is usually used to query the hit sample data. The storage format of the sample data is shown in Table 1.

[0061] Content Label scoreMap Picture1 Black Sample {"label1":y11,"label2":y12,"label3":y13,······} Picture2 Black Sample {"label1":y21,"label2":y22,"label3":y23,······} Picture3 White Sample {"label1":y31,"label2":y32,"label3":y33,······} …… …… ……

[0062] Table 1

[0063] As can be seen from the examples shown in Table 1, Content in Table 1 represents the content form of the sample, the sample data listed in Table 1 are all pictures that need to be identified, and Label indicates whether the sample data is risky sample data (i.e., black sample) or non-risky sample data (i.e., white sample). The scoreMap in Table 1 represents the actual label to which the sample data belongs in the strategy tree. Taking "label1":y11 as an example, the actual label is used to indicate that the sample data hits the first branch of the first layer from left to right in the strategy tree.

[0064] For the above recording method, the query time through polling is very time-consuming, and with the complexity of the verification rules and the increase of associated tags, the size of the data file and the query time will increase exponentially. Such an inefficient query method cannot meet the verification needs of high-frequency risk control strategies in the business.

[0065] In order to solve the problem of low query efficiency mentioned above, we can currently use the underlying support of DateFrame to operate on the entire Array, that is, to perform statistical operations on the full-day data of a certain column. However, since the vectorized column data supported by Dataframe must be of the same type, it is necessary to parse and merge the results of the strategy verification from the <string, integer> Json format into a wider Dataframe table, and then perform statistical operations, as shown in Table 2.

[0066] Content Label Label1 Label2 Label3 …… Picture1 Black Sample y11 y12 y13 …… Picture2 Black Sample Y21 y22 y23 …… Picture3 White Sample Y31 y32 y33 …… …… …… …… …… …… ……

[0067] Table 2

[0068] However, vectorized query under the Dataframe framework also has considerable resource overhead, which will significantly increase the time consumption of the strategy verification task. In addition, each threshold in the strategy tree will occupy new memory space. When the threshold or branch in the strategy tree, the memory space occupied will also increase. In addition, the process of converting from <string, integer> Json format to Dataframe wide table also requires a certain amount of conversion time and resource consumption.

[0069] In order to solve the above problems, an embodiment of the present specification provides a business execution method, which converts sample data and risk control strategies to be verified into vector files, thereby significantly improving the query efficiency while further reducing the storage space occupied by the execution of the strategy verification task, and further improving the verification efficiency and deployment efficiency of the risk control strategy.

[0070] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.

[0071] Figure 3A flowchart of a service execution provided in this specification includes the following steps:

[0072] S300: In response to a policy verification request, determine a sample set required for executing a policy verification task and a risk control policy to be verified. For each sample data in the sample set, the sample data is composed of a sample tag name and a tag value.

[0073] The execution subject of the business execution method provided in this specification can be a server in the risk control system, or a terminal device such as a desktop computer or a laptop used by risk control maintenance personnel. For the sake of ease of description, the business execution method provided in this specification is described below using the server as the execution subject.

[0074] In order to ensure that the risk control strategy can play an effective role in the user's business risk control, in this specification, the server can trigger the verification of the risk control strategy by obtaining a policy verification request.

[0075] Among them, the policy verification request can be generated by the risk control maintenance personnel by performing risk control operations, that is, the risk control maintenance personnel fills in the data required to perform the policy verification task in the preset policy verification interface and performs a confirmation operation. Then, the server can obtain the policy verification request based on the confirmation operation.

[0076] Of course, the policy verification request may also be a request generated by a scheduled task. For example, at each preset time, a task is triggered to verify the risk control policy used online, thereby generating a corresponding policy verification request.

[0077] In addition, the policy verification task can also be triggered based on the number of online business executions, so that the server can obtain a policy verification request. For example, for a payment business executed by a user, if the number of orders generated by the payment exceeds the specified number, it is considered necessary to verify the risk control strategy to deal with new risks that may arise. At this time, the policy verification task can be triggered to generate a policy verification request.

[0078] There may be other ways to trigger a policy verification request, which will not be described in detail here.

[0079] After responding to the above policy verification request, the server can determine the sample set required to perform the policy verification task and the risk control policy to be verified.

[0080] Among them, if the above-mentioned policy verification request is generated by the data filled in by the risk control maintenance personnel in the policy verification interface, the sample set required to execute the policy verification task and the risk control strategy to be verified can be determined based on the identification information of the risk control strategy to be verified filled in by the risk control maintenance personnel in the policy verification interface and the identification information of the required sample set.

[0081] If the above-mentioned policy verification request is triggered by a scheduled task or other means such as the growth of the number of businesses, the sample set required for executing the policy verification task and the risk control strategy to be verified may be pre-defined, that is, the sample set and the risk control strategy to be verified required for executing the policy verification task are pre-specified. Once the policy verification task is triggered, the required sample set and the risk control strategy to be verified may be directly determined.

[0082] Regardless of which one, the risk control strategy to be verified can be one risk control strategy that needs to be verified, or it can be multiple risk control strategies that need to be verified.

[0083] In this specification, each sample data in the sample set can be regarded as consisting of a sample label name and a label value. For example, for the sample data Picture1 in Table 2, it contains a group of data with a label name of Label2 and a label value of y12, so the sample data Picture1 can be regarded as a combination of Label2+y12. Of course, for the sample data Picture1, there is not only a group of data with a label name of Label2 and a label value of y12, but also data with a label name of Label1 and a label value of y11, a label name of Label3 and a label value of y13, etc. Therefore, the sample data Picture1 is actually formed by a combination of multiple label names + label values, but this sample data as a whole can be regarded as formed by a combination of label names + label values.

[0084] S302: The risk control strategy to be verified is transformed through a preset mapping dictionary to obtain a transformed risk control strategy, wherein the transformed risk control strategy includes a vector value range corresponding to the sample data that hits the risk control strategy to be verified, and, for each sample data in the sample set, the vector value of the sample label name corresponding to the sample data and the vector value of the label value corresponding to the sample data are determined through a preset mapping dictionary, and the vector value of the sample label name corresponding to the sample data and the vector value of the label value corresponding to the sample data are combined to obtain a sample vector corresponding to the sample data.

[0085] In order to improve the query efficiency during the strategy verification process, in this specification, the sample data in the determined sample set can be converted into vector form, and the risk control strategy to be verified can be converted into vector form, thereby improving the overall query efficiency through vector query.

[0086] To this end, the server can maintain a preset mapping dictionary in advance, which actually specifies the correspondence between some numbers and tag names and tag values. In other words, the tag name and tag value can be converted into a string of integers through the mapping dictionary.

[0087] For example, for the data set "Label1:76", the label value is integer data, and in the sample data, the label value range is between 0 and 100, so the 10-digit integer of LabelCode*1000+intScore can be used to re-express the data set "Label1:76". That is, the seven-digit integer 1000001 can be used to represent Label1, and the three-digit integer 076 can be used to represent the label value 76. Finally, the sample vector corresponding to the combined sample data is: 1000001076. The preset mapping dictionary can actually be understood as stipulating the corresponding relationships between Label1-100000 and 76-076.

[0088] As mentioned in Tables 1 and 2 above, the sample data actually contains multiple sets of label names + label values. Therefore, the multiple label names and label values ​​in the sample data can be converted separately through the preset mapping dictionary to obtain the corresponding sample vector. Therefore, the obtained sample vector can be regarded as a dense vector.

[0089] For the risk control strategy to be verified, a similar method can be used to convert the fields involving label values ​​in the risk control strategy to be verified into vector values, thereby obtaining a converted risk control strategy, which contains the vector value range corresponding to the sample data that hits the risk control strategy to be verified.

[0090] For example, for the risk control strategy to be verified: Label1: [Xa1, Xa2], after converting the label name and label value involved in the risk control strategy to be verified in the above manner, we can get: 1000001*1000+Xa1<=1000001*1000+intScoreA<=1000001*1000+Xa2. It can be clearly seen that the converted risk control strategy specifies the vector value range corresponding to the sample data that can hit the risk control strategy to be verified.

[0091] S304: Execute a strategy verification task according to the sample vector corresponding to each sample data in the sample set and the post-conversion risk control strategy.

[0092] After the sample vectors corresponding to the sample data are determined, the determined sample vectors may be stored first so as to perform query operations in the strategy verification task process in a subsequent process.

[0093] The server may first generate a sample vector file corresponding to the sample set according to a sample vector corresponding to each sample data in the sample set, and then store the sample vector file in a preset library.

[0094] The preset library mentioned in this manual may be the NumPy library, which is a very important and widely used library in the Python language, designed for large-scale numerical calculations. It is one of the indispensable and important technologies in the fields of scientific computing, data analysis, and machine learning.

[0095] The NumPy library has the following features:

[0096] The core of the NumPy library is a powerful N-dimensional array object called ndarray, which allows efficient storage and manipulation of homogeneous (i.e. all elements of the same type) multidimensional data sets. Compared to Python's native list, ndarray has significant improvements in memory usage and computing performance.

[0097] The NumPy library supports operations on the entire array without performing loop operations, which significantly improves execution efficiency.

[0098] The NumPy library supports numerical functions such as sin, cos, exp, etc.

[0099] The NumPy library automatically performs arithmetic operations on arrays of different shapes, a feature called broadcasting, which allows efficient and intuitive operations on arrays of sizes that do not exactly match.

[0100] On this basis, when the server performs the policy verification task based on the sample vector corresponding to each sample data in the sample set and the converted risk control strategy, it can actually determine the file copy slice based on the sample vector file. This slice actually allows the server to obtain part of the data in the file from the specified file starting position, file end position and set step size without performing a loop operation.

[0101] Therefore, in fact, by determining the file copy slice, the data to be read from the sample vector file when executing the query operation can be specified. Therefore, the server can read data from the stored sample vector file based on the file copy slice, and determine the sample data that falls within the vector value range in the converted risk control strategy, thereby obtaining the strategy verification result. However, the file copy slice does not actually copy part or all of the sample vector file.

[0102] For example, for a black sample in the sample set, the file copy slice for the black sample can be expressed as: black__benchmark=npy[npy[:,0]==100].

[0103] In the above code statement, npy[:,0]: This part means to select the elements of the first column (0) of all rows (:) in the npy array. In NumPy, such slicing operations are used to select a part of the array.

[0104] npy[:,0] == 100: Here we compare the first column elements selected in the previous step to see if they are equal to 100. This returns a Boolean array, where True means that the element at the corresponding position meets the condition (i.e., equal to 100), and False means that it does not meet the condition.

[0105] black__benchmark=npy[npy[:,0]==100]: This assignment operation selects all rows in the original array npy whose first column value is 100 and assigns these rows to the variable black__benchmark. In other words, black__benchmark now contains a subset of all rows in npy whose first column value is 100.

[0106] So, the above code statement as a whole means selecting all rows whose first column value is 100 from the NumPy array named npy and saving it to the variable black__benchmark.

[0107] Furthermore, for the NumPy library, it can create a view of an ndarray object when performing a query operation, and in the process no new memory space is actually allocated for the data in the created view. This is because the view only involves changes to the metadata of the original array (such as shape, strides, and data type) without copying the underlying data buffer.

[0108] Therefore, since the view shares the data buffer with the original array, creating a view takes up almost no additional memory space, which greatly saves memory resources and improves the running efficiency of query operations.

[0109] Therefore, in this specification, the server can determine and save the view corresponding to the sample vector file, wherein the determined view is used to represent the metadata corresponding to the sample vector file, and the so-called metadata is the data used to describe the sample vector file.

[0110] The server can then perform the policy verification task based on the view and the converted risk control strategy.

[0111] During this process, the server can read the sample vectors that meet the sample label names required by the post-conversion risk control strategy from the preset storage space based on the view, and then determine the number of sample vectors that hit the vector value range corresponding to the post-conversion risk control strategy from the read sample vectors as the hit number, and then perform the strategy verification task based on the hit data.

[0112] In addition, the query operation performed above needs to be completed based on the generated query statement. On this basis, the server can determine the query statement corresponding to the converted risk control strategy according to the converted risk control strategy and the preset query grammar. Among them, the preset query grammar mentioned here can refer to NumPy grammar.

[0113] The server can execute the query statement to determine sample data that hits the above vector value range from the sample set, and then perform the policy verification task based on the determined hitting sample data.

[0114] For example, the query statement generated by the server may be as follows:

[0115] def condition(input_array):

[0116] return

[0117] (((Numpy.any((1000001*1000+Xa1<=input_array<=1000001*1000+Xa2),axis=1))&Numpy.any((1000002*1000+Xb1<=input_array<=1000002*1000+Xa2),axis=1))

[0118] The purpose of the entire code is to check whether there is at least one element in each row of input_array that satisfies the two given interval conditions at the same time. If such an element exists, the result of the corresponding position is True, otherwise it is False.

[0119] That is to say, the above query statement is to query sample data with label values ​​that fall into both [Xa1, Xa2] and [Xb1, Xa2].

[0120] Furthermore, after determining that the sample data that hits the risk control policy to be verified is obtained, the server needs to further count it, that is, it needs to count the number of sample data that hits or the number of sample data that are missed.

[0121] For example, the server can complete the statistical process through the following code statements:

[0122] tp_cnt=condition(black__benchmark[:,1:10]).sum().

[0123] The main functions of the above code statement are: 1. Extract the data from the 2nd to the 10th columns of all rows from black__benchmark; 2. Apply the condition function to this data, which may be to check whether each element meets a certain condition; 3. Then calculate the total number of elements that meet the condition and assign this count to the variable tp_cnt.

[0124] In the above way, the server can complete the strategy verification task to verify whether the risk control strategy to be verified meets the preset risk control expectations. From the whole process, it can be seen that the server can convert the Json data of <string, integer> in the existing technology into dense vector data of integer type, so as to reduce the original label name and label value in the sample data into a string of integers, thereby avoiding the conversion operation of different data types in the original DataFrame framework during storage and calling.

[0125] Moreover, by using the NumPy library to store sample vector files, we can quickly complete the query operations required for the strategy verification task without occupying a large amount of storage space by using views that do not occupy storage space, while also effectively reducing the amount of calculation required for the actual query.

[0126] In addition, the method provided in this specification can also provide an operable interactive interface for risk control maintenance personnel, through which they can complete the selection of sample sets, input of risk control strategies, and execution of strategy verification operations, while the specific strategy verification logic is completed on the background server. Therefore, for risk control maintenance personnel, they can conveniently complete the strategy verification task without having to understand the background logic, thereby lowering the threshold for strategy verification to a certain extent.

[0127] It should be noted that the above-mentioned task execution method is described based on an actual scenario of verifying the risk control strategies required for risk control business. However, in actual applications, the task execution method provided in this specification is not limited to application in this actual scenario. Any verification of rules can be implemented using the method provided in this specification.

[0128] For example, for the preferential rules involved in online shopping by the user, the preferential rules to be verified can be verified by the above scheme to determine whether the preferential rules to be verified meet the preset business requirements. Examples of other actual scenarios are not described in detail here.

[0129] The above is a task execution method provided in one or more embodiments of this specification. Based on the same idea, this specification also provides a corresponding task execution device, such as Figure 4 shown.

[0130] Figure 4 A schematic diagram of a task execution device provided for this specification includes:

[0131] The determination module 401 is used to determine the sample set required for executing the policy verification task and the risk control policy to be verified in response to the policy verification request. For each sample data in the sample set, the sample data is composed of a sample tag name and a tag value;

[0132] The conversion module 402 is used to convert the risk control strategy to be verified through a preset mapping dictionary to obtain a converted risk control strategy, wherein the converted risk control strategy contains a vector value range corresponding to the sample data that hits the risk control strategy to be verified, and, for each sample data in the sample set, determine the vector value of the sample label name corresponding to the sample data and the vector value of the label value corresponding to the sample data through a preset mapping dictionary, and combine the vector value of the sample label name corresponding to the sample data and the vector value of the label value corresponding to the sample data to obtain a sample vector corresponding to the sample data;

[0133] The execution module 403 is used to execute a strategy verification task according to the sample vector corresponding to each sample data in the sample set and the post-conversion risk control strategy.

[0134] Optionally, the device further comprises:

[0135] The storage module 404 is used to generate a sample vector file corresponding to the sample set according to the sample vector corresponding to each sample data in the sample set and the post-conversion risk control strategy before the execution module 403 executes the strategy verification business; the sample vector file is stored in a preset library, and the preset library includes: NumPy library.

[0136] Optionally, the execution module 403 is specifically configured to determine a file copy slice according to the sample vector file; and execute a policy verification task according to the file copy slice and the post-conversion risk control policy.

[0137] Optionally, the execution module 403 is specifically used to determine and save the view corresponding to the sample vector file, where the view is used to represent the metadata corresponding to the sample vector file; and execute a policy verification task according to the view and the post-conversion risk control strategy.

[0138] Optionally, the execution module 403 is specifically used to, according to the view, read out sample vectors that meet the sample label names required by the post-conversion risk control strategy from a preset storage space; determine the number of sample vectors that hit the vector value range corresponding to the post-conversion risk control strategy from the read sample vectors as the number of hits; and execute the strategy verification task based on the hit data.

[0139] Optionally, the execution module 403 is specifically used to determine the query statement corresponding to the post-conversion risk control strategy according to the post-conversion risk control strategy and a preset query grammar; determine the sample data that hits the risk control strategy to be verified according to the query statement and the sample vector corresponding to each sample data in the sample set, and execute the strategy verification task based on the determined sample data that hits the risk control strategy to be verified.

[0140] The above device embodiments correspond to the method embodiments. For specific descriptions, please refer to the description of the method embodiments, which will not be repeated here. The device embodiments are obtained based on the corresponding method embodiments and have the same technical effects as the corresponding method embodiments. For specific descriptions, please refer to the corresponding method embodiments.

[0141] The present specification also provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded and executed by a processor as described above. Figure 3 The method of the embodiment shown in the figure can be specifically executed by referring to Figure 3 The specific description of the illustrated embodiment will not be repeated here.

[0142] The present specification also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor as described above. Figure 3 The method of the embodiment shown in the figure can be specifically executed by referring to Figure 3 The specific description of the illustrated embodiment will not be repeated here.

[0143] The embodiments of this specification also provide Figure 5 The structural diagram of the electronic device shown in FIG. Figure 5 At the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the above-mentioned task execution method.

[0144] Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the executor of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0145] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0146] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0147] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0148] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0149] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0150] This specification 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 this specification. 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 produce 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.

[0151] 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 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0152] 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.

[0153] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0154] The memory may include non-permanent storage 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.

[0155] 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 magnetic 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.

[0156] 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.

[0157] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0158] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0159] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0160] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.

Claims

1. A task execution method, comprising: In response to the policy verification request, determine the sample set required for executing the policy verification task and the risk control policy to be verified, and for each sample data in the sample set, the sample data is composed of a sample tag name and a tag value; The risk control strategy to be verified is transformed through a preset mapping dictionary to obtain a transformed risk control strategy, wherein the transformed risk control strategy contains a vector value range corresponding to the sample data that hits the risk control strategy to be verified, and, for each sample data in the sample set, the vector value of the sample label name corresponding to the sample data and the vector value of the label value corresponding to the sample data are determined through a preset mapping dictionary, and the vector value of the sample label name corresponding to the sample data and the vector value of the label value corresponding to the sample data are combined to obtain a sample vector corresponding to the sample data; A strategy verification task is performed according to the sample vector corresponding to each sample data in the sample set and the post-conversion risk control strategy.

2. The method according to claim 1, before executing the strategy verification task according to the sample vector corresponding to each sample data in the sample set and the post-conversion risk control strategy, the method further comprises: Generate a sample vector file corresponding to the sample set according to the sample vector corresponding to each sample data in the sample set; The sample vector file is stored in a preset library, and the preset library includes: a NumPy library.

3. The method according to claim 2, performing a strategy verification task according to the sample vector corresponding to each sample data in the sample set and the post-conversion risk control strategy, specifically comprising: Determine a file copy slice according to the sample vector file; A policy verification task is performed according to the file copy slice and the post-conversion risk control strategy.

4. The method according to claim 2, performing a strategy verification task according to the sample vector corresponding to each sample data in the sample set and the post-conversion risk control strategy, specifically comprising: Determine and save a view corresponding to the sample vector file, where the view is used to represent metadata corresponding to the sample vector file; A strategy verification task is performed according to the view and the post-conversion risk control strategy.

5. The method according to claim 4, performing a strategy verification task according to the view and the post-conversion risk control strategy, specifically comprising: According to the view, a sample vector having a sample label name required by the post-conversion risk control strategy is read from a preset storage space; Determine the number of sample vectors that hit the vector value range corresponding to the post-conversion risk control strategy from the read sample vectors as the number of hits; According to the hit data, a strategy verification task is performed.

6. The method according to claim 1 or 2, characterized in that: According to the sample vector corresponding to each sample data in the sample set and the post-conversion risk control strategy, a strategy verification task is performed, specifically including: Determine a query statement corresponding to the post-conversion risk control strategy according to the post-conversion risk control strategy and a preset query grammar; According to the query statement and the sample vector corresponding to each sample data in the sample set, the sample data that hits the risk control strategy to be verified is determined, and the strategy verification task is performed according to the determined sample data that hits the risk control strategy to be verified.

7. A task execution device, comprising: A determination module, configured to determine, in response to a policy verification request, a sample set required for executing a policy verification task and a risk control policy to be verified, wherein for each sample data in the sample set, the sample data is composed of a sample tag name and a tag value; A conversion module, used to convert the risk control strategy to be verified through a preset mapping dictionary to obtain a converted risk control strategy, wherein the converted risk control strategy contains a vector value range corresponding to the sample data that hits the risk control strategy to be verified, and, for each sample data in the sample set, determine the vector value of the sample label name corresponding to the sample data and the vector value of the label value corresponding to the sample data through a preset mapping dictionary, and combine the vector value of the sample label name corresponding to the sample data and the vector value of the label value corresponding to the sample data to obtain a sample vector corresponding to the sample data; An execution module is used to execute a strategy verification task according to a sample vector corresponding to each sample data in the sample set and the post-conversion risk control strategy.

8. The device of claim 7, further comprising: A storage module, configured to generate a sample vector file corresponding to the sample set according to the sample vector corresponding to each sample data in the sample set before the execution module executes the strategy verification service according to the sample vector corresponding to each sample data in the sample set and the post-conversion risk control strategy; The sample vector file is stored in a preset library, and the preset library includes: a NumPy library.

9. In the device as described in claim 8, the execution module is specifically used to determine the file copy slice according to the sample vector file; and execute the policy verification task according to the file copy slice and the post-conversion risk control strategy.

10. In the device as described in claim 8, the execution module is specifically used to determine and save the view corresponding to the sample vector file, wherein the view is used to represent the metadata corresponding to the sample vector file; and execute the policy verification task according to the view and the post-conversion risk control strategy.

11. In the device as described in claim 10, the execution module is specifically used to read out sample vectors that meet the sample label names required by the post-conversion risk control strategy from a preset storage space according to the view; determine the number of sample vectors that hit the vector value range corresponding to the post-conversion risk control strategy from the read sample vectors as the hit number; and execute the strategy verification task according to the hit data.

12. In the device as described in claim 7 or 8, the execution module is specifically used to determine the query statement corresponding to the post-conversion risk control strategy according to the post-conversion risk control strategy and a preset query grammar; determine the sample data that hits the risk control strategy to be verified according to the query statement and the sample vector corresponding to each sample data in the sample set, and execute the strategy verification task according to the determined sample data that hits the risk control strategy to be verified.

13. A computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 6 when executing the program.

Citation Information

Patent Citations

  • A method and a device for risk control strategy and business risk control

    CN109002949A

  • Test case generation and test method and device, apparatus and system

    CN110221965A

  • Risk control strategy simulation evaluation method, device and apparatus

    CN112784420A

  • Risk control rule generation method and apparatus

    IN202047030736A

  • Systems and methods for data management using zero-touch tagging

    US20180121476A1