A model processing method, a risk prevention and control processing method, device and equipment
By calculating the attention weights and mean values of supporting event categories through meta-learning methods, a target model for trusted scenarios is generated. This solves the problem of rapidly responding to new risks in trusted environments, achieving efficient, stable, and interpretable risk identification while protecting user privacy.
Patent Information
- Application Number
- CN202211675809.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-26
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2042-12-26
AI Technical Summary
In a trusted environment, existing models struggle to respond quickly to new risks without backtracking all past features, and they also lack efficient, stable, and robust risk identification capabilities, while failing to protect user privacy and provide interpretability.
The meta-learning method is adopted to obtain the features, sample label information and support set in the sample data, determine the attention weights and quantities of different event categories in the support set, calculate the first and second category centers, and train the model by combining the attention mechanism and the mean to generate the target model in the credible scenario.
It enables rapid response to new risks without having to backtrack all past features, improving the model's timeliness and robustness, providing interpretable risk control results, and protecting user privacy.
Smart Images

Figure CN115983858B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present document relates to the technical field of computer technology, and particularly relates to a model processing method and device, and a risk prevention and control method and device. BACKGROUND
[0002] In the process of using an online payment tool for payment, a transaction event often needs to be analyzed for risks. In general, the risks contained in a transaction event can include theft, fraud, illegal financial activities, etc. The goal of a model in a trusted environment is to find out risk-free data for fast release, which can reduce the disturbance to users and save system computing resources.
[0003] Due to the changing payment risk situation, it is particularly important to ensure that the model in the trusted environment at the front end of the risk control system, which is responsible for most data traffic release, remains efficient and stable. On the one hand, the update of the risk triggering method requires that the model be regularly retrained and updated to meet the coverage requirements of newly added black sample data, corresponding to the timeliness requirement. On the other hand, the current stable operation of the model in the online trusted environment should not be broken, that is, the model updating process guided by different types of new risks and new triggering methods under the same risk should maintain the robustness of the model recognition ability and should not be easily attacked by black production. Furthermore, the result output by the model in the trusted environment should be interpretable, and finally, the release process of the model in the trusted environment should fully protect the privacy of the user. Therefore, it is necessary to provide a technical solution that can depict the user's daily transaction behavior pattern to achieve the effect of "near white and far black" in trusted release. In addition, in the face of different types of new risks, new triggering methods under the same risk, and other new risks, how to ensure timeliness without backtracking the past full features. SUMMARY
[0004] The purpose of the embodiments of the present specification is to provide a technical solution that can depict the user's daily transaction behavior pattern to achieve the effect of "near white and far black" in trusted release. In addition, in the face of different types of new risks, new triggering methods under the same risk, and other new risks, how to ensure timeliness without backtracking the past full features.
[0005] To achieve the above technical solutions, the embodiments of the present specification are implemented as follows:
[0006] The method provided by the embodiment of the present specification comprises: obtaining sample data applied to meta-learning, wherein the sample data comprises features of corresponding events, sample label information, and a support set, the support set comprises a plurality of different event categories, and the support set comprises support sample data corresponding to each event category. Based on the sample data, attention weights corresponding to support sample data of different event categories in the support set, and the number of support sample data contained in different event categories in the support set, first category centers corresponding to different event categories in the support set are determined, and based on the sample data, the mean value of the features corresponding to different event categories in the support set is determined, and the determined mean value is taken as the second category center corresponding to different event categories in the support set. The target model applied to a trusted scenario is trained based on the first category center corresponding to different event categories in the support set, the second category center corresponding to different event categories in the support set, and the sample data, to obtain a trained target model.
[0007] The method provided by the embodiment of the present specification comprises: receiving a trained target model sent by a server, and determining first category centers and second category centers of different event categories corresponding to the trained target model, wherein the trained target model is obtained based on sample data applied to meta-learning, attention weights corresponding to support sample data of different event categories in a support set in the sample data, and the number of support sample data contained in different event categories in the support set, the first category centers corresponding to different event categories in the support set are determined, and based on the sample data, the mean value of the features corresponding to different event categories in the support set is determined, and the determined mean value is taken as the second category center corresponding to different event categories in the support set, the model is obtained based on the first category center corresponding to different event categories in the support set, the second category center corresponding to different event categories in the support set, and the sample data, the model is obtained based on the model trained by the target model applied to a trusted scenario, the sample data comprises features of corresponding events, sample label information, and a support set, the support set comprises a plurality of different event categories, and the support set comprises support sample data corresponding to each event category. Business data generated by executing a target business in the trusted scenario is obtained. The features of the corresponding events of the business data are obtained, and the features of the corresponding events of the business data are encoded to obtain target encoded features, based on the target encoded features, and the first category center and the second category center of different event categories corresponding to the trained target model, the event category corresponding to the business data is determined. Based on the determined event category, risk prevention and control processing is performed on the target business executed by the first user.
[0008] The embodiment of the present specification provides a model processing device, the device comprises: a sample acquisition module, acquiring sample data applied to meta-learning, the sample data comprising features corresponding to events, sample label information and a support set, the support set comprising a plurality of different event categories and support sample data corresponding to each event category; a category center determination module, determining first category centers corresponding to different event categories in the support set based on the sample data, attention weights corresponding to support sample data of different event categories in the support set and the number of support sample data contained in different event categories in the support set, and determining the mean of the features corresponding to different event categories in the support set based on the sample data, and taking the determined mean as the second category center corresponding to different event categories in the support set; and a training module, training a target model applied to a trusted scenario based on the first category centers corresponding to different event categories in the support set, the second category centers corresponding to different event categories in the support set and the sample data, to obtain a trained target model.
[0009] The embodiment of the present specification provides a risk prevention and control processing device, the device comprises: a risk prevention and control processing device, the device comprises: a model deployment module, receiving a trained target model sent by a server, and determining first category centers and second category centers of different event categories corresponding to the trained target model, the trained target model being obtained based on sample data applied to meta-learning, attention weights corresponding to support sample data of different event categories in a support set in the sample data and the number of support sample data contained in different event categories in the support set, determining first category centers corresponding to different event categories in the support set, and determining the mean of features corresponding to different event categories in the support set based on the sample data, and taking the determined mean as the second category center corresponding to different event categories in the support set, training a target model applied to a trusted scenario based on the first category centers corresponding to different event categories in the support set, the second category centers corresponding to different event categories in the support set and the sample data, to obtain a model obtained after model training, the sample data comprising features corresponding to events, sample label information and a support set, the support set comprising a plurality of different event categories and support sample data corresponding to each event category; a business data acquisition module, acquiring business data generated by executing a target business in the trusted scenario; a category determination module, acquiring features corresponding to events of the business data, and performing encoding processing on the features corresponding to events of the business data to obtain target encoded features, determining an event category corresponding to the business data based on the target encoded features and the first category centers and the second category centers of different event categories corresponding to the trained target model; and a risk prevention and control module, performing risk prevention and control processing on the target business executed by the first user based on the determined event category.
[0010] The model processing device provided by the embodiments of the present specification comprises: a processor; and a memory arranged to store computer executable instructions, which, when executed, cause the processor to: obtain sample data applied to meta-learning, wherein the sample data comprises features of a corresponding event, sample label information, and a support set, the support set comprises a plurality of different event categories, and support sample data corresponding to each event category. Based on the sample data, attention weights corresponding to support sample data of different event categories in the support set, and the number of support sample data contained in different event categories in the support set, determine first category centers corresponding to different event categories in the support set, and based on the sample data, determine the mean of the features corresponding to different event categories in the support set, and take the determined mean as the second category center corresponding to different event categories in the support set. Based on the first category center corresponding to different event categories in the support set, the second category center corresponding to different event categories in the support set, and the sample data, a target model applied to a trusted scenario is trained to obtain a trained target model.
[0011] The embodiment of the specification provides a risk prevention and control processing device, the risk prevention and control processing device comprises a processor and a memory arranged to store computer executable instructions, the executable instructions enable the processor to receive a trained target model sent by a server, and determine a first category center and a second category center of different event categories corresponding to the trained target model, the trained target model is determined based on sample data applied to meta-learning, attention weights corresponding to support sample data of different event categories in a support set in the sample data, and the number of support sample data contained by different event categories in the support set, the first category center corresponding to different event categories in the support set is determined, and the mean value of the features corresponding to different event categories in the support set is determined based on the sample data, the determined mean value is taken as the second category center corresponding to different event categories in the support set, the model is obtained based on the first category center corresponding to different event categories in the support set, the second category center corresponding to different event categories in the support set and the sample data, the model is trained on the target model applied in a trusted scenario, the sample data includes features, sample label information and a support set corresponding to an event, the support set includes a plurality of different event categories, and support sample data corresponding to each event category. Business data generated by executing a target business in the trusted scenario is obtained. The features of the event corresponding to the business data are obtained, and the features of the event corresponding to the business data are encoded to obtain target encoded features, based on the target encoded features, and the first category center and the second category center of different event categories corresponding to the trained target model, the event category corresponding to the business data is determined. Based on the determined event category, the risk prevention and control processing is performed on the target business executed by the first user.
[0012] The embodiment of the present specification further provides a storage medium for storing computer executable instructions, which, when executed by a processor, implement the following process: obtaining sample data applied to meta-learning, wherein the sample data comprises features of corresponding events, sample label information and a support set, the support set comprises a plurality of different event categories and support sample data corresponding to each event category; determining first category centers corresponding to different event categories in the support set based on the sample data, attention weights corresponding to support sample data of different event categories in the support set and the number of support sample data contained in different event categories in the support set, and determining the mean of the features corresponding to different event categories in the support set based on the sample data, and taking the determined mean as second category centers corresponding to different event categories in the support set; and performing model training on a target model applied to a trusted scenario based on the first category centers corresponding to different event categories in the support set, the second category centers corresponding to different event categories in the support set and the sample data, to obtain a trained target model.
[0013] The embodiment of the present specification further provides a storage medium for storing computer executable instructions, which, when executed by a processor, implement the following process: receiving a trained target model sent by a server, and determining first category centers and second category centers of different event categories corresponding to the trained target model, wherein the trained target model is obtained by determining first category centers corresponding to different event categories in a support set based on sample data applied to meta-learning, attention weights corresponding to support sample data of different event categories in the support set and the number of support sample data contained in different event categories in the support set, and determining the mean of features corresponding to different event categories in the support set based on the sample data, and taking the determined mean as second category centers corresponding to different event categories in the support set, performing model training on a target model applied to a trusted scenario based on the first category centers corresponding to different event categories in the support set, the second category centers corresponding to different event categories in the support set and the sample data, to obtain the model, wherein the sample data comprises features of corresponding events, sample label information and a support set, the support set comprises a plurality of different event categories and support sample data corresponding to each event category; obtaining business data generated by performing a target business in the trusted scenario; obtaining features of corresponding events of the business data, and performing encoding processing on the features of corresponding events of the business data to obtain target encoded features; determining an event category corresponding to the business data based on the target encoded features and the first category centers and the second category centers of different event categories corresponding to the trained target model; and performing risk prevention and control processing on the target business performed by the first user based on the determined event category. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0015] Figure 1 This is an embodiment of a processing method for a model of this specification;
[0016] Figure 2 This is another example of a processing method for this specification;
[0017] Figure 3 This is a schematic diagram of the structure of an encoder in this specification;
[0018] Figure 4 This is a schematic diagram of a model structure of this manual;
[0019] Figure 5A This is an embodiment of a risk prevention and control method in this specification;
[0020] Figure 5B This is a schematic diagram of a risk prevention and control process in this manual;
[0021] Figure 5C This is a schematic diagram of the structure of a risk prevention and control processing system in this manual;
[0022] Figure 6 This is a schematic diagram of another risk prevention and control process in this manual;
[0023] Figure 7 This is a processing device embodiment of a model of this specification;
[0024] Figure 8 This is an embodiment of a risk prevention and control processing device in this specification;
[0025] Figure 9 This is an embodiment of a processing device in this specification. DETAILED DESCRIPTION
[0026] The embodiments of this specification provide a method, device, and equipment for processing a model and risk prevention and control.
[0027] To help those skilled in the art better understand the technical solutions in this specification, the following will provide a clear and complete description of the technical solutions in the embodiments of this specification, in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. All other embodiments derived by those skilled in the art based on the embodiments in this specification without creative effort shall fall within the scope of protection of this specification.
[0028] Example 1
[0029] like Figure 1 As shown, the embodiments of this specification provide a model processing method. The execution subject of this method can be a server, etc., wherein the server can be an independent server or a server cluster composed of multiple servers. The server can be a backend server for financial services or online shopping services, or a backend server for an application. The method can specifically include the following steps:
[0030] In step S102, sample data for meta-learning is obtained. The sample data includes features of corresponding events, sample label information, and a support set. The support set includes multiple different event categories and supporting sample data corresponding to each event category.
[0031] The sample data can be sample data used for training a specified model, and the sample data can be relevant data obtained from a specified business. The specified business can be any business, for example, the specified business can be a payment business, a transfer business, or an instant messaging business, and the like, which can be set according to actual conditions, and the embodiments of the present specification do not limit this. The sample data can be one or multiple, and the sample data can be positive sample data or negative sample data. The relevant data can be business data related to the specified business, which can be determined according to the specified business. For example, if the specified business is a payment business, the sample data can include payment time, location, payment amount, account information of the payer, account information of the receiver, and the like. In addition, the sample data can include images, audio data, and the like in addition to the text data described above, for example, images for biological identification, such as face images, fingerprint images, palmprint images, iris images, and the like, which can be set according to actual conditions, and the embodiments of the present specification do not limit this. The features of the sample data corresponding to the event can be features corresponding to a fraudulent event to which the sample data belongs, or can be features corresponding to a trusted event to which the sample data belongs, and the like, which can be set according to actual conditions, and the embodiments of the present specification do not limit this. The sample label information can be represented by an event category. For example, the event category includes a fraud category, and the sample label information of a certain sample data can be fraud. For another example, the event category includes a trusted category, and the sample label information of a certain sample data can be trusted, and the like. The support set can be a Support Set, which can include multiple different event categories, such as a trusted category, a stolen category, and a fraud category, and the like. The support sample data corresponding to each event category can be represented in the form of data features. For example, the trusted category can correspond to support sample data [[0, 1, 0, …], [1, 0, 1], …], the stolen category can correspond to support sample data [[1, 1, 2, …], [2, 3, 4, …], …], and the fraud category can correspond to support sample data [[2, 1, 4, …], [2, 4, 1, …], …], and the like, which can be set according to actual conditions. The goal of meta-learning is to quickly learn how to respond when encountering a new task or migrating to a new environment according to previous experience and a small amount of sample data.
[0032] In implementation, in the process of payment by a user using an online payment tool, it is often necessary to perform risk analysis on a transaction event. Generally, the risks contained in a transaction event can include theft, fraud, illegal financial activities, etc. The goal of the model in the trusted environment is to quickly release the risk-free data, which can reduce the disturbance to the user on the one hand, and save the computing resources of the system on the other hand. Generally speaking, the model in the trusted environment can release more than 90% of the data flow in the existing risk control system, and only 10% of the data flow flows to the deep analysis layer for fine analysis. Due to the key position of the model in the trusted environment in the risk control system, the timeliness of the follow-up of new risks, the robustness of the model when attacked, and the requirements of explainability and privacy protection are also higher than those of general models.
[0033] Due to the changing payment risk situation, it is particularly important to ensure that the model in the trusted environment responsible for most data traffic release at the front end of the risk control system remains efficient and stable. On the one hand, the update of the risk triggering method requires that the model be updated regularly to meet the coverage requirements of new black sample data, corresponding to the timeliness requirement; on the other hand, the current stable operation of the model in the online trusted environment should not be broken, that is, the model updating process guided by different types of new risks and new triggering methods of the same risk should maintain the robustness of the model recognition ability and should not be easily attacked by black production, furthermore, the output result of the model in the trusted environment should be interpretable, finally, the release process of the model in the trusted environment should fully protect the privacy of the user. Generally, the modeling scheme of the model in the trusted environment has the following multiple ways: (1) for different risk domains, historical black and white samples are modeled respectively, and the model is regularly retrained, this way can decouple each risk logic, and when the risk situation of a single domain changes, it can be retrained separately without affecting each other, but this way requires a large amount of storage space, and for models that need to analyze the total data flow, all original sample data and corresponding features need to be retained; (2) using multi-task learning modeling method, the risks of different risk domains are jointly modeled, the storage and computing resources required by this method are less than the first method, but the logical coupling degree is high, and when new risks occur, the global multi-task model needs to be adjusted, and the above two methods are slow to respond to new risks, often requiring model retraining to cover risks that have never been encountered before, if the update is not timely, it is easy to cause risk leakage, and user transaction features are often directly stored in the cloud, without giving full privacy protection, in addition, the above two methods often focus on distinguishing black and white samples, and the definition of white is relatively simple, lacking interpretability. Therefore, a technical solution is needed to describe the user's daily transaction behavior pattern to achieve the effect of "near white and far black" in trusted release, in addition, how to ensure timeliness without backtracking the past total features in the face of different types of new risks, new triggering methods and other new risks. The embodiments of the present specification provide a feasible technical solution, which can specifically include the following contents.
[0034] In the process of model training of a certain model, a certain amount of data can be obtained from the relevant data recorded in advance in the designated business (or from the designated historical database) as sample data applied to meta-learning. Since the modeling is performed in the manner of meta-learning, the form of the sample data can be summarized as Query Set and Support Set. For a single sample data, it can be represented as [event_id, feature, label], wherein event_id is the event identifier corresponding to the current sample data, feature represents the features of the sample data corresponding event (which can include multiple dimensions of features), and label represents the sample label information (such as trusted, stolen, fraud or illegal financial activities, etc.). Query Set can be Query Set in meta-learning. Analogous to the organization form of the above single sample data, it can be used as a driving event table. Support Set can be Support Set in meta-learning. For each user, a local white Support Set (i.e., trusted class) and multiple global black Support Sets (including stolen class, fraud class, illegal financial activity class, etc.) can be maintained. The local white Support Set is sampled from a certain number (such as 100 or 200, etc.) of transaction data in the user's own past normal transactions as sample data, and each sample data is as described above for the same multi-dimensional features. The global black Support Set is sampled from the global black sample data before the time of the event in Query Set. The difference between local and global lies in whether it is associated with the user of the event in Query Set. For white Support Set, it is local, meaning the user's own past low-risk, daily repeated transaction behavior pattern; for black Support Set, it is global, meaning high-risk transaction events.
[0035] Based on the above, the final form of the sample data can be [event_id, label, feature, support_set]. Specifically, a certain sample data can be as follows
[0036]
[0037] That is, when the category of the event in the pen Query Set is theft, the feature of the event corresponding to the sample data is [1, 0, 0,...], and the dimension can be D; the dimension of the category in the corresponding Support Set can be 100xD, which means that 100 support sample data are maintained for each category in the support set. Denote the number of categories as K, then the dimension of the Support Set in each sample data is Kx100xD, and the final model training goal is to make the event feature representation close to the theft category in the support set and far away from other categories. It should be noted that in the data preparation stage, for each driving event, the time of the event in the Support Set maintained by the event needs to be earlier than the time of the event itself.
[0038] In step S104, based on the above sample data, the attention weight corresponding to the support sample data of different event categories in the support set, and the number of support sample data contained in different event categories in the support set, the first category center corresponding to different event categories in the support set is determined, and based on the above sample data, the mean value of the features corresponding to different event categories in the support set is determined, and the determined mean value is taken as the second category center corresponding to different event categories in the support set.
[0039] Among them, the attention weight can be determined by an attention mechanism, and the attention mechanism can include a plurality of mechanisms, such as a temporal attention mechanism or a spatial attention mechanism, or it can also be a Soft Attention or a Hard Attention, etc. The specific setting can be determined according to the actual situation.
[0040] In implementation, for the Prototypical Network, a category center is usually calculated for each event category in the support set, and then the feature calculated for the event is compared with each category center to determine which category it should belong to. The formula for calculating the category center can be as follows:
[0041]
[0042] Among them, c k represents the category center of the kth category, (x i , y i ) is the feature and event category of the i th support sample data in the Support Set, f(x i ) represents the feature of the kth category support sample data in the Support Set, S kThe number of support sample data of the kth class in the support set. However, the above method is mainly used for image classification, the feature input and the event category are homogeneous, and the data is clean, so the concept of class center is effective. In the scenario of the present specification, there is more than one class center for the trusted transactions, suspicious transactions and risk transactions of the user history. In addition, in the image field, each image in the support set contributes equally to the prototype, while in the scenario of the present specification, some of the transaction behavior events in the user support set are routine, and some are occasional and should not be treated equally. Some occasional transactions may have a large deviation from the class center obtained by the averaging process. Therefore, the embodiments of the present specification improve the above process, that is, on the basis of the above class center, a class center corresponding to the attention mechanism is added. Specifically, the corresponding algorithm can be preset according to the actual situation, then the support sample data corresponding to a certain event category in the support set in the above sample data, the attention weight corresponding to the support sample data of the event category in the support set, and the number of support sample data of the event category contained in the support set can be obtained. The feature corresponding to the support sample data of the event category can be multiplied by the attention weight corresponding to the support sample data of the event category in the corresponding support set and then added to obtain a corresponding calculation result. The calculation result can be used as the first class center corresponding to the event category in the support set. The first class center corresponding to other event categories can be calculated in the same way. Finally, the first class center corresponding to different event categories in the support set can be obtained.
[0043] In addition, the mean of the features corresponding to different event categories in the support set can be determined based on the above sample data by using the above formula, and the determined mean can be used as the second class center corresponding to different event categories in the support set. For details, please refer to the above related content and the above formula, which will not be repeated here.
[0044] In step S106, the target model applied in the trusted scenario is trained based on the first class center corresponding to different event categories in the support set, the second class center corresponding to different event categories in the support set, and the sample data, to obtain a trained target model.
[0045] In implementation, the embodiments of the present specification jointly use the first category center generated based on the attention mechanism and the second category center generated by simple arithmetic mean as the basis for driving event classification of the Query Set. For each event category, there are two category centers, i.e., one second category center generated by arithmetic mean and one first category center generated by attention weighting. Then, for K event categories, there are 2*K category centers. For the driving event in the Query Set, its final category is determined by the distance between the sample data corresponding to the features and the 2*K category centers. That is, the distance between the sample data corresponding to the features and the first category center corresponding to different event categories in the support set is calculated, and the distance between the sample data corresponding to the features and the second category center corresponding to different event categories in the support set is calculated. Based on the two distances calculated above and the preset loss function, the target model applied in the trusted scenario is trained to obtain the trained target model.
[0046] The embodiments of the present specification provide a processing method of a model. The sample data applied in meta-learning is obtained, the sample data includes the features corresponding to the event, the sample label information and the support set, the support set includes a plurality of different event categories, and the support sample data corresponding to each event category. Then, based on the sample data, the attention weight corresponding to the support sample data of different event categories in the support set and the number of support sample data contained in different event categories in the support set, the first category center corresponding to different event categories in the support set is determined, and based on the sample data, the mean of the features corresponding to different event categories in the support set is determined as the second category center corresponding to different event categories. Finally, based on the first category center, the second category center and the sample data, the target model applied in the trusted scenario is trained to obtain the trained target model. In this way, a trusted solution based on metric meta-learning is proposed. The user local white prototype (i.e., the target model in the trusted environment) is calculated to describe the user's daily transaction behavior pattern, and the trusted release effect of "near white and far black" is achieved through metric learning. In addition, new risks such as new risks of different event categories and new triggering methods under the same risk can be quickly iterated based on their features without backtracking the past full features, greatly improving the timeliness. In addition, the output result contains the comparison with the local white sample data itself, and the basis for trusted release is not only "far from global black" but also "near local white", which has certain explainability. After the model training is completed, the subsequent user's own features can be placed on the user's terminal device side, and the real-time calculation process can be completed on the user's terminal device side. The cloud does not perceive the specific information of the user's past transactions, and has the function of privacy protection.
[0047] Embodiment two
[0048] As Figure 2As shown, the embodiment of the present specification provides a model processing method, the execution subject of the method can be a server or the like, wherein the server can be an independent server, or a server cluster composed of multiple servers, etc., the server can be a background server of a financial service or a network shopping service, etc., or a background server of an application program, etc. The method can specifically include the following steps:
[0049] In step S202, sample data applied to meta-learning is obtained, the sample data includes features corresponding to events, sample label information and support sets, the support sets include multiple different event categories and support sample data corresponding to each event category.
[0050] Among them, the event category can include one or more of the trusted category, the theft category, the fraud category, and the illegal financial activity category.
[0051] In step S204, the support sample data corresponding to each event category in the support set in the above sample data is encoded to obtain the encoding features corresponding to each support sample data.
[0052] In implementation, the encoding mechanism can be pre-set according to actual conditions, which can include multiple, for example, the matrix or vector corresponding to different characters can be pre-set according to actual conditions, thereby constructing a corresponding reference table, when it is necessary to process the support sample data, the characters contained in the support sample data can be analyzed, the matrix or vector corresponding to the characters contained in the support sample data can be found in the above reference table, and the encoding of the support sample data corresponding to each event category in the support set in the above sample data can be processed. The found matrix or vector can be used as the encoding features corresponding to each support sample data.
[0053] It should be noted that the above is the encoding processing of the support sample data by constructing a reference table, in actual application, in addition to the above method, the support sample data can also be encoded by other different methods, for example, the above encoding mechanism can be constructed by a neural network model, the support sample data can be encoded by the encoding mechanism constructed by the neural network model, which can be set according to actual conditions, and the present specification does not limit this.
[0054] The specific processing of the above step S204 can be various, and the following provides an optional processing method, which can include the following contents: the support sample data corresponding to each event category in the support set in the sample data is encoded by a pre-set encoder to obtain the encoding features corresponding to each support sample data, and the encoder is constructed based on the Encoder in the Transformer model.
[0055] As shown in the following formula (1), the Encoder in the Transformer model can be composed of a Multi-Head Attention layer, an Add&Norm layer, a Feed Forward layer, and an Add&Norm layer. The Multi-Head Attention layer can be a network layer of a multi-head attention mechanism. The Add&Norm layer is composed of an Add and a Norm. The calculation formulas of the two parts are as follows: Figure 3
[0056] LayerNorm(X+MultiHeadAttention(X))
[0057] LayerNorm(X+FeedForward(X))
[0058] The Feed Forward layer is two fully connected layers. The activation function of the first fully connected layer is Relu, and the second fully connected layer does not use the activation function. The corresponding formulas can be as follows:
[0059] max(0, XW1+b1)W2+b2
[0060] where X represents a variable, and W1, b1, W2, and b2 represent parameters, respectively.
[0061] In implementation, each event category corresponding support sample data in the support set in the above sample data can be input into the above encoder. Through the processing of the Encoder in the Transformer model in the encoder, the encoding features corresponding to each support sample data can be obtained.
[0062] In step S206, based on the encoding features corresponding to each support sample data, the preset attention weights corresponding to the support sample data of different event categories in the support set, and the number of support sample data contained by different event categories in the support set, the first category center corresponding to different event categories in the support set is determined.
[0063] where the attention weight can be a weight determined based on the mean value of the features corresponding to the different event categories in the support set in the above sample data, through a feedforward neural network and a preset activation function, and the number of support sample data contained by different event categories in the support set.
[0064] In implementation, the self-attention mechanism based on the coarse category center and the support sample data of different event categories in the support set can be used. The self-attention mechanism is an algorithm that only needs to determine which features the target model should focus on according to the input. The calculation process of the self-attention mechanism can include: converting the input data into embedded vectors; creating a Query vector, a Key vector, and a Value vector for each embedded vector, which are obtained by multiplying the embedded vectors of the input data and three conversion matrices (W_Q, W_K, and W_V). The three matrices are learned in the training process; calculating the corresponding score for each embedded vector, score = Query vector dot product Key vector; dividing the score by the square root of the dimension of the key vector, which can make the gradient more stable, and then normalizing the score by the softmax function so that the sum is 1; multiplying the score obtained by the softmax function with the corresponding value vector, so as to retain the value of the focused feature and weaken the value of the irrelevant feature; accumulating all the weighted value vectors, which can obtain the output result of the self-attention algorithm at a certain position.
[0065] The processing mode of the category center can be improved as follows
[0066]
[0067] wherein, represents the i-th support sample data in the k-th event category, represents the encoded feature of the support sample data after being processed by the encoder, n k is the number of support sample data of the k-th event category, c k is the first category center (i.e., Prototype) corresponding to the k-th event category, α ki represents the attention weight assigned to the i-th support sample data in the k-th event category. α ki can be as follows:
[0068]
[0069]
[0070]
[0071]
[0072] is the class center involved in the original Prototypical Networks, i.e., the second class center. ffn() represents a feed-forward neural network, and σ() is a preset activation function, which can be tanh, etc.
[0073] The score e of each support sample data for each event category ki In the corresponding event category, the final attention weight is assigned by performing softmax processing ki Thus, the final output of the first class center c corresponding to the kth event category is obtained k .
[0074] In step S208, based on the above sample data, the mean value of the features corresponding to different event categories in the support set is determined, and the determined mean value is taken as the second class center corresponding to different event categories in the support set.
[0075] Among them, the second class center can be the above The second class center can be calculated according to the above formula, which will not be described here.
[0076] In step S210, the distances between the sample data and the first class centers corresponding to different event categories in the support set are calculated respectively, and the distances between the sample data and the second class centers corresponding to different event categories in the support set are calculated respectively. Based on the calculated distances, the target model used in the trusted scenario is trained to obtain the trained target model.
[0077] In implementation, the model structure involved in the embodiment can be as shown in Figure 4 .
[0078] As can be seen from the above formula for calculating the second class center, the Prototypical Networks generates the class center by averaging the samples in the class.
[0079]
[0080] As shown in the above calculation formulas of Add and Norm, the probability distribution of the support sample data belonging to each class is obtained by taking the negative distance between the feature vector and the prototype vector through softmax, where the distance function can be any distance function as long as it is derivable. The above uses the squared Euclidean distance.
[0081] However, the above-mentioned method is mainly used for image classification, the feature input and the event category are homogeneous, and the data is clean, so the concept of category center is effective. In the scenario of the present specification, there are more than one category center for the trusted transactions, suspicious transactions and risk transactions of the user history. In addition, in the image field, the contribution of each image in the Support Set to the prototype is equal, while in the scenario of the present specification, some of the transaction behavior events in the user Support Set are routine, and some are occasional, and should not be treated equally. Some occasional transactions may have a large deviation on the category center obtained by the averaging process. Therefore, the following improvement can be made, that is, the weighted voting mechanism of the category center. Unlike the classification method using only the second category center, the present embodiment uses the first category center c k The second category center generated by simple arithmetic average Together as the basis for Query Set driven event classification, for each event category, there are two category centers, one second category center generated by arithmetic average and one first category center generated by attention weighted, then K event categories total 2*K category centers, for the driving event in Query Set, which category it finally belongs to is determined by its distance from the above 2*K category centers.
[0082]
[0083]
[0084]
[0085] And there are
[0086]
[0087] Wherein, cosin() is the dot product, which measures The distance (or similarity) between each category center c i The distance (or similarity) between each category center c Here, the features of the support sample data in the Query Set are used for encoding, and the same set of parameters is used for the encoder in the Support Set.
[0088] The model training can be performed on the target model applied in the trusted scenario based on the sample data of the specified time period based on the format of the sample data in step S202 and the model structure described above, and a trained target model is obtained. The obtained target model should have the following functions: after the sample data of the pen event is encoded, the obtained encoding feature should be as close as possible to the class center of the same event category in its own support set, and as far as possible from the class centers of other event categories.
[0089] After the corresponding model is trained in the above manner, the model can be deployed and applied. The model can be deployed on the server side or the terminal device side. For the case of being deployed on the server side, refer to the processing of steps S212-S218.
[0090] In step S212, the business data generated by the first user in the trusted scenario is obtained.
[0091] The first user can be any user, and in this embodiment, the first user can be the user performing the target service. The target service can be any service, such as a payment service, a transfer service, or an instant messaging service, etc. The specific business data related to the target service can be determined according to the actual situation. For example, if the target service is a payment service, the business data can include payment time, location, payment amount, account information of the payer, account information of the receiver, etc. The specific business data can be set according to the actual situation, and the present embodiment does not limit it. The trusted scenario can be a scenario in which the probability of risk occurrence is relatively stable and much lower than the probability of market risk. The accumulation of trusted data in the trusted scenario can help to release low-risk transaction events and reduce the analysis amount of the identification layer.
[0092] In implementation, after the target model is trained in the above manner, the target model is deployed in the server. When the first user triggers the target service execution through the terminal device, the terminal device performs the target service through information interaction with the server. Then, the terminal device can obtain the business data generated in the process of the first user performing the target service, and can send the business data to the server. The server can obtain the business data generated by the first user in the trusted scenario.
[0093] In step S214, the feature of the event corresponding to the business data is obtained, and the feature of the event corresponding to the business data is encoded to obtain the target encoding feature.
[0094] In implementation, feature extraction can be performed on the business data to obtain the features of the event corresponding to the business data. Then, the features of the event corresponding to the business data can be input into the encoder constructed by the Encoder in the Transformer model, and the features of the event corresponding to the business data are encoded by the encoder to obtain the target encoding features.
[0095] In step S216, based on the target encoding features, and the first class center and the second class center of different event categories corresponding to the trained target model, the event category corresponding to the business data is determined.
[0096] In implementation, the distance between the target encoding features and the first class center of different event categories corresponding to the trained target model can be calculated respectively, and the distance between the target encoding features and the second class center of different event categories corresponding to the trained target model can be calculated respectively. Based on the calculated distance, the event category corresponding to the business data is determined. Specifically, the minimum value of the calculated distance can be obtained, the class center corresponding to the minimum value can be obtained, and the event category corresponding to the class center can be obtained. The obtained event category can be taken as the event category corresponding to the business data. Specifically, the event category corresponding to the minimum value is fraud, and the event category corresponding to the business data is fraud. Or, the event category corresponding to the minimum value is trusted, and the event category corresponding to the business data is trusted. The specific implementation can be set according to actual conditions, and the embodiments of the present application are not limited thereto.
[0097] In actual application, the first class center and the second class center can be obtained by the terminal device of the first user after calculation, and the information is sent to the server. For details, see the following: receiving the first class center and the second class center of different event categories corresponding to the trained target model sent by the terminal device of the first user.
[0098] In implementation, the server can deploy the trained target model to the terminal device of the first user, and can update the support set Support Set corresponding to the trained target model regularly or irregularly. The terminal device can calculate the first class center and the second class center of different event categories corresponding to the trained target model based on the updated support set Support Set by the above method. For details, see the foregoing related content, which will not be repeated here.
[0099] In step S218, based on the determined event category, the target business performed by the first user is subjected to risk prevention and control processing.
[0100] In implementation, if the determined event category is the fraud category, the target business executed by the first user can be subjected to risk prevention and control processing through a preset risk prevention and control mechanism, specifically, the first user can be rejected to continue executing the target business, etc. If the determined event category is the trusted category, the first user can be allowed to execute the target business, etc., which can be set according to actual conditions, and the embodiments of the present specification do not limit this.
[0101] In addition, the server can also deploy the trained target model in the specified terminal device, so that the terminal device applies the target model, which can be specifically referred to the processing of steps A2 to A6.
[0102] In step A2, the trained target model is deployed in the terminal device of the second user.
[0103] The second user can be any user, and in the embodiments, the second user can be a user who needs to deploy the trained target model. The terminal device can be a mobile terminal device such as a mobile phone or a tablet computer, and can also be a computer device such as a notebook computer or a desktop computer, or can also be an IoT device (such as a smart watch, a vehicle-mounted device, etc.).
[0104] In step A4, when the preset update period is reached, an update support set corresponding to the trained target model is obtained, the update support set including a plurality of different event categories and support sample data corresponding to each event category.
[0105] The update period can include a plurality of types, for example, the update period can be 24 hours or 7 days, etc., which can be set according to actual conditions, and the embodiments of the present specification do not limit this.
[0106] In step A6, the update support set is provided to the terminal device, and the update support set is used to trigger the terminal device to update the support set corresponding to the trained target model.
[0107] In implementation, when a new event category appears or the characteristics of a certain event category change, the new event category and the update support set corresponding to the new event category can be obtained, or the event category with changed characteristics and the update support set corresponding to the event category can be obtained. The update support set can be provided to the terminal device, and the terminal device can use the update support set to update the current support set of the trained target model. In addition, the terminal device can also recompute the first category center and the second category center through the above calculation method, and can use the recomputed first category center and the second category center for risk prevention and control processing.
[0108] The embodiment of the present specification provides a processing method of a model, by obtaining sample data applied to meta learning, the sample data including features corresponding to events, sample label information and a support set, the support set including a plurality of different event categories and support sample data corresponding to each event category, then determining first category centers corresponding to different event categories in the support set based on the sample data, attention weights corresponding to support sample data of different event categories in the support set and the number of support sample data contained in different event categories in the support set, and determining the mean of the features corresponding to different event categories in the support set as the second category center corresponding to different event categories based on the sample data, finally, based on the first category center, the second category center and the sample data, a target model applied to a trusted scenario is trained to obtain a trained target model, thus a trusted solution based on metric meta learning is proposed, the user's local white prototype (i.e. the target model in the trusted environment) is calculated to describe the user's daily transaction behavior pattern, and the trusted release "near white, far black" effect is achieved through metric learning. In addition, new risks such as new risks of different event categories and new triggering methods under the same risk can be quickly iterated based on their features without backtracking past full features, greatly improving timeliness. In addition, the output result contains comparison with the local white sample data itself, and the basis for trusted release is not only "far from global black" but also "near local white", which has certain explainability. After the model training is completed, the subsequent user's own features can be placed on the user's terminal device side, and the real-time calculation process can be completed on the user's terminal device side, and the cloud does not perceive the specific information of the user's past transactions, having the function of privacy protection.
[0109] In addition, the new risk has the ability to quickly iterate and update, that is, when a new risk mode appears, it can be quickly supplemented to the user's support set Support Set through sampling and updated to the corresponding category center, which is much more efficient than model retraining. In addition, the model provides the output of the category center of the user's historical transaction local white features, which means the user's daily low-risk transaction behavior pattern. When a case occurs, the white representation can be traced back to calculate its similarity with the case, providing evidence for the explainability of the case.
[0110] Embodiment three
[0111] As shown in Figure 5A and Figure 5B The embodiment of the present specification provides a processing method of risk prevention and control, the execution subject of the method can be a terminal device, wherein the terminal device can be a mobile terminal device such as a mobile phone, a tablet computer, etc., can also be a computer device such as a notebook computer or a desktop computer, or can also be an IoT device (such as a smart watch, a vehicle-mounted device, etc.). The corresponding system architecture diagram can be as shown in Figure 5CThe method can specifically include the following steps:
[0112] In step S502, the receiving server sends the trained target model, and determines the first class center and the second class center of different event categories corresponding to the trained target model. The trained target model is determined based on the sample data applied to meta-learning, the attention weight corresponding to the support sample data of different event categories in the support set in the sample data, and the number of support sample data contained in different event categories in the support set. The first class center corresponding to different event categories in the support set is determined, and the mean value of the features corresponding to different event categories in the support set is determined based on the sample data. The determined mean value is taken as the second class center corresponding to different event categories in the support set. The model is obtained by applying the target model in a trusted scenario based on the first class center corresponding to different event categories in the support set, the second class center corresponding to different event categories in the support set, and the sample data. The sample data includes features corresponding to events, sample label information, and a support set. The support set includes a plurality of different event categories, and support sample data corresponding to each event category.
[0113] The specific process of determining the first class center and the second class center of different event categories corresponding to the trained target model can be calculated by the above formula, and will not be described here.
[0114] In step S504, the business data generated by executing the target business in the trusted scenario is obtained.
[0115] In step S506, the features of the event corresponding to the above business data are obtained, and the features of the event corresponding to the business data are encoded to obtain target encoded features. Based on the target encoded features, and the first class center and the second class center of different event categories corresponding to the trained target model, the event category corresponding to the business data is determined.
[0116] In step S508, based on the determined event category, the target business executed by the first user is subjected to risk prevention and control processing.
[0117] The specific process of steps S504-S508 can be referred to the foregoing related content, and will not be described here.
[0118] The embodiment of the specification provides a model processing method. The method comprises the following steps: receiving a trained target model sent by a server, and determining first category centers and second category centers of different event categories corresponding to the trained target model. The trained target model is determined based on sample data applied to meta-learning, attention weights of support sample data of different event categories in a support set in the sample data, and the number of support sample data contained in the different event categories in the support set. The first category centers corresponding to the different event categories in the support set are determined. The mean value of the features corresponding to the different event categories in the support set is determined based on the sample data. The mean value determined is taken as the second category center corresponding to the different event categories in the support set. The model is obtained by performing model training on the target model applied to a trusted scenario based on the first category centers corresponding to the different event categories in the support set, the second category centers corresponding to the different event categories in the support set, and the sample data. The sample data comprises features corresponding to events, sample label information, and a support set. The support set comprises a plurality of different event categories and support sample data corresponding to each event category. Business data generated by performing a target business in a trusted scenario is obtained. The features corresponding to events of the business data are obtained. The features corresponding to events of the business data are encoded to obtain target encoded features. Based on the target encoded features and the first category centers and the second category centers of the different event categories corresponding to the trained target model, the event category corresponding to the business data is determined. Based on the determined event category, risk prevention and control processing is performed on the target business performed by a first user. In this way, a trusted solution based on metric meta-learning is proposed. The user's local white prototype (i.e., the target model in a trusted environment) is calculated to describe the user's daily transaction behavior pattern. The trusted release effect of "near white and far black" is achieved through metric learning. In addition, new risks such as different event categories of new risks, new triggering methods under the same risk, and the like can be quickly iterated based on their features without backtracking past full features, greatly improving timeliness. In addition, the output result contains a comparison with the local white sample data itself. The basis for trusted release is not only "far from global black" but also "near local white", which has certain explainability. After model training is completed, the subsequent user's own features can be placed on the terminal device side of the user. The real-time calculation process can be completed on the terminal device side of the user. The cloud does not perceive specific information of the user's past transactions, and has a privacy protection function.
[0119] Embodiment four
[0120] As Figure 6As shown, the embodiment of the present specification provides a risk prevention and control processing method, the execution subject of the method can be a terminal device, wherein the terminal device can be a mobile terminal device such as a mobile phone, a tablet computer, etc., can also be a computer device such as a notebook computer or a desktop computer, or can also be an IoT device (such as a smart watch, a vehicle-mounted device, etc.). The method can specifically include the following steps:
[0121] In step S602, the trained target model sent by the receiving server is received, and the first category center and the second category center of different event categories corresponding to the trained target model are determined. The trained target model is determined based on the sample data applied to meta-learning, the attention weight corresponding to the support sample data of different event categories in the support set in the sample data, and the number of support sample data contained by different event categories in the support set. The first category center corresponding to different event categories in the support set is determined, and the mean value of the features corresponding to different event categories in the support set is determined based on the sample data. The mean value is taken as the second category center corresponding to different event categories in the support set. The model is obtained by training the target model applied to the trusted scenario based on the first category center corresponding to different event categories in the support set, the second category center corresponding to different event categories in the support set, and the sample data. The sample data includes features corresponding to events, sample label information, and a support set. The support set includes a plurality of different event categories, and support sample data corresponding to each event category.
[0122] Wherein, the specific processing of determining the first category center and the second category center of different event categories corresponding to the trained target model can be calculated by the above formula, which will not be repeated here.
[0123] In step S604, the business data generated by executing the target business in the trusted scenario is obtained.
[0124] In step S606, the features of the event corresponding to the above business data are obtained, and the features of the event corresponding to the business data are encoded to obtain target encoded features. Based on the target encoded features, and the first category center and the second category center of different event categories corresponding to the trained target model, the event category corresponding to the business data is determined.
[0125] In step S608, based on the determined event category, the target business executed by the first user is subjected to risk prevention and control processing.
[0126] The specific processing of steps S604-S608 can be referred to the foregoing related content, which will not be repeated here.
[0127] In step S610, when the preset update period is reached, an updated support set corresponding to the trained target model is acquired from the server, the updated support set including a plurality of different event categories and support sample data corresponding to each event category.
[0128] In step S612, the support set corresponding to the trained target model is updated based on the updated support set.
[0129] In implementation, the terminal device can use the updated support set to update the current support set of the trained target model, in addition, the terminal device can also recalculate the first category center and the second category center through the above calculation method, and can use the recalculated first category center and the second category center for risk prevention and control processing, that is, execute the processing of steps S304-S308.
[0130] The embodiment of the specification provides a model processing method. The method comprises the following steps: receiving a target model trained by a server, and determining a first category center and a second category center of different event categories corresponding to the target model. The target model is trained based on sample data applied to meta-learning, attention weights of support sample data of different event categories in a support set in the sample data, and the number of support sample data contained in the different event categories in the support set. The first category center corresponding to the different event categories in the support set is determined, and the mean value of the features corresponding to the different event categories in the support set is determined based on the sample data. The mean value is taken as the second category center corresponding to the different event categories in the support set. The model is obtained by training the target model applied to a trusted scenario based on the first category center corresponding to the different event categories in the support set, the second category center corresponding to the different event categories in the support set, and the sample data. The sample data comprises features corresponding to events, sample label information, and a support set. The support set comprises a plurality of different event categories and support sample data corresponding to each event category. Business data generated by executing a target business in a trusted scenario is obtained. The features corresponding to events of the business data are obtained, and the features corresponding to events of the business data are encoded to obtain target encoded features. Based on the target encoded features, the first category center and the second category center of the different event categories corresponding to the target model trained, the event category corresponding to the business data is determined. Based on the determined event category, the target business executed by a first user is subjected to risk prevention and control processing. In this way, a trusted solution based on metric meta-learning is proposed. The user's local white prototype (i.e., the target model in a trusted environment) is calculated to describe the user's daily transaction behavior pattern, and the metric learning method is used to achieve the effect of "near white and far black" in trusted release. In addition, new risks such as different event categories of new risks, new triggering methods under the same risk, and the like can be quickly iterated based on their features without backtracking past full features, greatly improving timeliness. In addition, the output result contains a comparison with the local white sample data, and the basis for trusted release is not only "far from global black" but also "near local white", which has certain explainability. After the model training is completed, the subsequent user's own features can be placed on the terminal device side of the user, and the real-time calculation process can be completed on the terminal device side of the user. The cloud does not perceive specific information of the user's past transactions, and has the function of privacy protection.
[0131] In addition, the model has the ability to quickly iterate and update for new risks, that is, when a new risk mode appears, it can be quickly supplemented to the user's support set by sampling and issued, and the corresponding category center is updated, which is more timely than model retraining. In addition, the model provides the output of the category center of the local white feature of the user's historical transaction, which means the user's daily low-risk transaction behavior mode. When a case occurs, the white feature can be calculated to calculate its similarity with the case, providing evidence for the explainability of the case.
[0132] Embodiment five
[0133] The above is the processing method of the model provided by the embodiments of the present specification, based on the same idea, the embodiments of the present specification also provide a model processing device, as shown in Figure 7 .
[0134] The model processing device comprises a sample acquisition module 701, a category center determination module 702 and a training module 703, wherein:
[0135] The sample acquisition module 701 acquires sample data applied to meta-learning, wherein the sample data comprises feature, sample label information and support set corresponding to an event, the support set comprises a plurality of different event categories and support sample data corresponding to each event category;
[0136] The category center determination module 702 determines a first category center corresponding to different event categories in the support set based on the sample data, attention weights corresponding to support sample data of different event categories in the support set and the number of support sample data contained in different event categories in the support set, and determines the mean value of the feature corresponding to different event categories in the support set based on the sample data, and takes the determined mean value as a second category center corresponding to different event categories in the support set;
[0137] The training module 703 trains a target model applied to a trusted scenario based on the first category center corresponding to different event categories in the support set, the second category center corresponding to different event categories in the support set and the sample data, to obtain a trained target model.
[0138] In the embodiments of the present specification, the category center determination module 702 comprises:
[0139] The encoding unit encodes the support sample data corresponding to each event category in the support set in the sample data to obtain an encoded feature corresponding to each support sample data;
[0140] The category center determination unit determines a first category center corresponding to each event category in the support set in the support set based on the encoded feature corresponding to each support sample data, the preset attention weight corresponding to the support sample data of different event categories in the support set, and the number of support sample data contained by different event categories in the support set.
[0141] In an embodiment of the present specification, the encoding unit encodes the support sample data corresponding to each event category in the support set in the sample data by a preset encoder, to obtain an encoded feature corresponding to each support sample data, and the encoder is constructed based on an Encoder in a Transformer model.
[0142] In an embodiment of the present specification, the attention weight is a weight determined based on the mean of the features corresponding to different event categories in the support set, the sample data, and a preset activation function through a feedforward neural network and the number of support sample data contained by different event categories in the support set.
[0143] In an embodiment of the present specification, the training module 703 respectively calculates the distance between the sample data and the first category center corresponding to different event categories in the support set, and respectively calculates the distance between the sample data and the second category center corresponding to different event categories in the support set, and performs model training on a target model used in a trusted scenario based on the calculated distances to obtain a trained target model.
[0144] In an embodiment of the present specification, the event category includes one or more of a trusted category, a theft category, a fraud category, and an illegal financial activity category.
[0145] In an embodiment of the present specification, the apparatus further includes:
[0146] The business data acquisition module acquires business data generated by the first user performing a target business in the trusted scenario;
[0147] The encoding module acquires a feature of an event corresponding to the business data, and encodes the feature of the event corresponding to the business data to obtain a target encoded feature;
[0148] The category determination module determines an event category corresponding to the business data based on the target encoded feature, and the first category center and the second category center of different event categories corresponding to the trained target model;
[0149] The risk prevention and control module performs risk prevention and control processing on the target business performed by the first user based on the determined event category.
[0150] In an embodiment of the present specification, the apparatus further includes:
[0151] a category center receiving module, configured to receive first and second category centers of different event categories corresponding to the trained target model sent by the terminal device of the first user.
[0152] In the embodiments of the present specification, the apparatus further comprises:
[0153] a deployment module, configured to deploy the trained target model in the terminal device of the second user;
[0154] an update set obtaining module, configured to obtain an update support set corresponding to the trained target model when a preset update period is reached, the update support set including a plurality of different event categories and support sample data corresponding to each event category;
[0155] an update set providing module, configured to provide the update support set to the terminal device, the update support set being used to trigger the terminal device to update the support set corresponding to the trained target model.
[0156] The embodiments of the present specification provide a model processing apparatus, by obtaining sample data applied to meta-learning, the sample data including features corresponding to events, sample label information and a support set, the support set including a plurality of different event categories and support sample data corresponding to each event category, then determining first category centers corresponding to different event categories in the support set based on the sample data, attention weights corresponding to the support sample data of different event categories in the support set and the number of support sample data contained in different event categories in the support set, and determining the mean of the features corresponding to different event categories in the support set as second category centers corresponding to different event categories in the support set based on the sample data, finally, performing model training on a target model applied to a trusted scenario based on the first category centers, the second category centers and the sample data to obtain a trained target model, thus, a trusted solution based on metric meta-learning is proposed, by calculating a user local white prototype (i.e. a target model in a trusted environment) to depict the user's daily transaction behavior pattern, and by using the method of metric learning to achieve the effect of "near white and far black" in trusted release, in addition, new risks such as new risks of different event categories and new triggering methods under the same risk can be quickly iterated based on their features without backtracking past full features, greatly improving timeliness. In addition, the output result contains a comparison with the local white sample data itself, and the basis for trusted release is not only "far from global black" but also "near local white", which has certain explainability. After model training is completed, the subsequent user's own features can be placed on the terminal device side of the user, and the real-time calculation process can be completed on the terminal device side of the user, and the cloud does not perceive the specific information of the user's past transactions, having the function of privacy protection.
[0157] In addition, the new risk can be quickly updated, that is, when a new risk mode appears, the support set of the user can be quickly supplemented by sampling and updating the corresponding category center, which is more timely than model retraining. In addition, the model provides the category center of the local white feature of the user's historical transaction, which means that the user's daily low-risk transaction behavior mode can be traced back to calculate the similarity with the case, which provides evidence for the explainability of the case.
[0158] Embodiment six
[0159] Based on the same idea, the embodiments of the present specification also provide a risk prevention and control processing device, as shown in Figure 8
[0160] The risk prevention and control processing device comprises a model deployment module 801, a business data acquisition module 802, a category determination module 803 and a risk prevention and control module 804, wherein:
[0161] The model deployment module 801 receives the trained target model sent by the server, and determines the first category center and the second category center of different event categories corresponding to the trained target model. The trained target model is determined based on the sample data applied to meta-learning, the attention weight corresponding to the support sample data in the support set of different event categories in the sample data, and the number of support sample data contained in the support set of different event categories. The first category center corresponding to different event categories in the support set is determined, and the mean value of the features corresponding to different event categories in the support set is determined based on the sample data. The mean value is taken as the second category center corresponding to different event categories in the support set. The model is obtained by training the target model applied to the trusted scenario based on the first category center corresponding to different event categories in the support set, the second category center corresponding to different event categories in the support set, and the sample data. The sample data includes features, sample label information and support set corresponding to events, the support set includes a plurality of different event categories, and the support sample data corresponding to each event category;
[0162] The business data acquisition module 802 acquires the business data generated by executing the target business in the trusted scenario;
[0163] The category determination module 803 acquires the features of the event corresponding to the business data, and encodes the features of the event corresponding to the business data to obtain target encoded features. Based on the target encoded features, and the first category center and the second category center of different event categories corresponding to the trained target model, the event category corresponding to the business data is determined;
[0164] The risk prevention and control module 804 performs risk prevention and control processing on the target business performed by the first user based on the determined event category.
[0165] In the embodiments of the present specification, the device further comprises:
[0166] The update set acquisition module acquires an update support set corresponding to the trained target model from the server when a preset update period is reached, the update support set including a plurality of different event categories and support sample data corresponding to each event category;
[0167] The update module updates the support set corresponding to the trained target model based on the update support set.
[0168] The embodiment of the specification provides a processing device of a model. The processing device receives a trained target model sent by a server, and determines a first category center and a second category center of different event categories corresponding to the trained target model. The trained target model is determined based on sample data applied to meta learning, attention weights corresponding to support sample data of different event categories in a support set in the support sample data of different event categories in the support set, and a quantity of support sample data contained in the support sample data of different event categories in the support set. The first category center corresponding to different event categories in the support set is determined, and the mean value of the features corresponding to different event categories in the support set is determined based on the sample data. The mean value determined is taken as the second category center corresponding to different event categories in the support set. The model is obtained by performing model training on the target model applied to a trusted scenario based on the first category center corresponding to different event categories in the support set, the second category center corresponding to different event categories in the support set, and the sample data. The sample data includes features corresponding to events, sample label information, and a support set. The support set includes a plurality of different event categories and support sample data corresponding to each event category. Business data generated by performing a target business in a trusted scenario is obtained. The features corresponding to events of the business data are obtained, and the features corresponding to events of the business data are processed to obtain target coding features. Based on the target coding features, the first category center and the second category center of different event categories corresponding to the trained target model, the event category corresponding to the business data is determined. Based on the determined event category, the target business performed by a first user is subjected to risk prevention and control processing. In this way, a trusted solution based on metric meta learning is proposed. The user's local white prototype (i.e., the target model in the trusted environment) is calculated to describe the user's daily transaction behavior pattern, and the trusted release "near white and far black" effect is achieved through metric learning. In addition, new risks such as different event categories of new risks, new triggering methods under the same risk, and the like can be quickly iterated based on their features without backtracking past full features, greatly improving timeliness. In addition, the output result contains a comparison with the local white sample data itself, and the basis for trusted release is not only "far from global black" but also "near local white", which has certain explainability. After the model training is completed, the subsequent user's own features can be placed on the terminal device side of the user, and the real-time calculation process can be completed on the terminal device side of the user. The cloud does not perceive specific information of past transactions of the user, and has a privacy protection function.
[0169] In addition, the model has the ability to quickly iterate and update for new risks, that is, when a new risk mode appears, it can be quickly supplemented to the user's support set and the corresponding category center is updated, which is more timely than model retraining. In addition, the model provides the output of the category center of the local white feature of the user's historical transaction, which means the user's daily low-risk transaction behavior mode. When a case occurs, the similarity between the white feature and the case can be calculated, which provides evidence for the explainability of the case.
[0170] Embodiment Seven
[0171] The processing device of the model provided in the above embodiments of the present specification is based on the same idea. The present specification also provides a processing device of the model, as shown in Figure 9 .
[0172] The processing device of the model can be provided in the server provided in the above embodiments.
[0173] The processing device of the model can have great differences due to different configurations or performances, and can include one or more processors 901 and memories 902. The memories 902 can store one or more storage applications or data. The memories 902 can be temporary storage or persistent storage. The applications stored in the memories 902 can include one or more modules (not shown in the figure), and each module can include a series of computer executable instructions in the processing device of the model. Further, the processor 901 can be configured to communicate with the memory 902 and execute a series of computer executable instructions in the memory 902 on the processing device of the model. The processing device of the model can also include one or more power supplies 903, one or more wired or wireless network interfaces 904, one or more input and output interfaces 905, and one or more keyboards 906.
[0174] In particular, in the present embodiment, the processing device of the model includes a memory and one or more programs, wherein one or more programs are stored in the memory, and the one or more programs can include one or more modules, and each module can include a series of computer executable instructions in the processing device of the model, and the one or more processors are configured to execute the one or more programs, which include the following computer executable instructions:
[0175] Obtaining sample data applied to meta-learning, wherein the sample data includes feature of corresponding event, sample label information and support set, the support set includes a plurality of different event categories and support sample data corresponding to each event category;
[0176] determine first class centers corresponding to different event categories in the support set based on the sample data, the attention weights corresponding to the support sample data of different event categories in the support set, and the number of support sample data contained by different event categories in the support set, and determine the mean values of the features corresponding to different event categories in the support set based on the sample data, and take the determined mean values as second class centers corresponding to different event categories in the support set;
[0177] perform model training on the target model applied to the trusted scenario based on the first class centers corresponding to different event categories in the support set, the second class centers corresponding to different event categories in the support set, and the sample data, to obtain the trained target model.
[0178] In the embodiments of the present specification, the determination of the first class centers corresponding to different event categories in the support set based on the sample data, the preset attention weights corresponding to the support sample data of different event categories in the support set, and the number of support sample data contained by different event categories in the support set comprises:
[0179] perform encoding processing on the support sample data corresponding to each event category in the support set in the sample data to obtain the encoding features corresponding to each support sample data;
[0180] determine the first class centers corresponding to different event categories in the support set based on the encoding features corresponding to each support sample data, the preset attention weights corresponding to the support sample data of different event categories in the support set, and the number of support sample data contained by different event categories in the support set.
[0181] In the embodiments of the present specification, the encoding processing on the support sample data corresponding to each event category in the support set in the sample data to obtain the encoding features corresponding to each support sample data comprises:
[0182] perform encoding processing on the support sample data corresponding to each event category in the support set in the sample data through a preset encoder to obtain the encoding features corresponding to each support sample data, and the encoder is constructed based on an Encoder in a Transformer model.
[0183] In the embodiments of the present specification, the attention weight is a weight determined based on the sample data, the mean values of the features corresponding to different event categories in the support set, and a feedforward neural network and a preset activation function, and the number of support sample data contained by different event categories in the support set.
[0184] In the embodiments of the present specification, the first category center corresponding to different event categories in the support set, the second category center corresponding to different event categories in the support set, and the sample data are applied to the target model in a trusted scenario for model training to obtain a trained target model, which comprises:
[0185] The distances between the sample data and the first category center corresponding to different event categories in the support set are calculated respectively, and the distances between the sample data and the second category center corresponding to different event categories in the support set are calculated respectively. The distances are applied to the target model in a trusted scenario for model training to obtain a trained target model.
[0186] In the embodiments of the present specification, the event categories include one or more of trusted categories, theft categories, fraud categories, and illegal financial activity categories.
[0187] In the embodiments of the present specification, it further comprises:
[0188] Obtaining business data generated by the first user performing target business in the trusted scenario;
[0189] Obtaining the features of the event corresponding to the business data, and performing encoding processing on the features of the event corresponding to the business data to obtain target encoded features;
[0190] Based on the target encoded features, and the first category center and the second category center of different event categories corresponding to the trained target model, determining the event category corresponding to the business data;
[0191] Based on the determined event category, performing risk prevention and control processing on the target business performed by the first user.
[0192] In the embodiments of the present specification, it further comprises:
[0193] Receiving the first category center and the second category center of different event categories corresponding to the trained target model sent by the terminal device of the first user.
[0194] In the embodiments of the present specification, it further comprises:
[0195] Deploying the trained target model in the terminal device of the second user;
[0196] When a preset update cycle is reached, obtaining an update support set corresponding to the trained target model, the update support set comprising a plurality of different event categories and support sample data corresponding to each event category;
[0197] provide the terminal device with the updated support set, which is used to trigger the terminal device to update the support set corresponding to the trained target model.
[0198] In addition, based on the same idea, the embodiments of the present specification also provide a risk prevention and control processing device, as shown in the following. Figure 9 The risk prevention and control processing device can be provided in the terminal device provided in the above embodiments. Specifically, in the present embodiment, the model processing device comprises a memory and one or more programs, wherein one or more programs are stored in the memory, and the one or more programs can include one or more modules, and each module can include a series of computer executable instructions in the model processing device, and the one or more programs configured to be executed by one or more processors include computer executable instructions for:
[0199] receiving the trained target model sent by the server, and determining the first category center and the second category center of different event categories corresponding to the trained target model, wherein the trained target model is determined based on the sample data applied to meta-learning, the attention weight corresponding to the support sample data in the support set of different event categories in the sample data, and the number of support sample data contained in the support set of different event categories, the first category center corresponding to different event categories in the support set is determined, and the mean value of the features corresponding to different event categories in the support set is determined based on the sample data, and the determined mean value is taken as the second category center corresponding to different event categories in the support set, and the model is trained based on the first category center corresponding to different event categories in the support set, the second category center corresponding to different event categories in the support set, and the sample data applied to the target model in the trusted scenario, wherein the sample data includes the features, sample label information and support set corresponding to the event, the support set includes a plurality of different event categories, and the support sample data corresponding to each event category;
[0200] obtaining business data generated by executing target business in the trusted scenario;
[0201] obtaining the features of the event corresponding to the business data, and performing encoding processing on the features of the event corresponding to the business data to obtain target encoded features, determining the event category corresponding to the business data based on the target encoded features and the first category center and the second category center of different event categories corresponding to the trained target model;
[0202] based on the determined event category, performing risk prevention and control processing on the target business executed by the first user.
[0203] In the embodiments of the present specification, the following are also included:
[0204] when a preset update period is reached, obtaining an update support set corresponding to the trained target model from the server, the update support set including a plurality of different event categories and support sample data corresponding to each event category;
[0205] updating the support set corresponding to the trained target model based on the update support set.
[0206] The embodiment of the present specification provides a processing device, by obtaining sample data applied to meta-learning, the sample data including features corresponding to events, sample label information and a support set, the support set including a plurality of different event categories and support sample data corresponding to each event category, then, based on the sample data, attention weights corresponding to the support sample data of different event categories in the support set, and the number of support sample data contained in different event categories in the support set, determining first category centers corresponding to different event categories in the support set, and based on the sample data, determining the mean of the features corresponding to different event categories in the support set as second category centers corresponding to different event categories, finally, based on the first category centers, the second category centers and the sample data, performing model training on a target model applied to a trusted scenario to obtain a trained target model, in this way, a trusted solution based on metric meta-learning is proposed, by calculating the user's local white prototype (i.e. the target model in the trusted environment), the user's daily transaction behavior pattern is described, and the effect of "near white, far black" is achieved through metric learning. In addition, new risks such as different event categories of new risks and new triggering methods under the same risk can be quickly iterated based on their features without backtracking past full features, greatly improving timeliness. In addition, the output result contains a comparison with the local white sample data itself, and the basis for trusted release is not only "far from global black" but also "near local white", which has certain explainability. After model training is completed, the subsequent user's own features can be placed on the user's terminal device side, and the real-time calculation process can be completed on the user's terminal device side, and the cloud does not perceive the specific information of the user's past transactions, having the function of privacy protection.
[0207] In addition, it has the ability to quickly iterate and update for new risks, that is, when a new risk mode appears, it can be quickly supplemented to the user's support set Support Set through sampling and issued, and the corresponding category center is updated, which is much more efficient than model retraining. In addition, the model provides the output of the category center of the user's historical transaction local white features, which means the user's daily low-risk transaction behavior pattern, which can be traced back when a case occurs to calculate its similarity with the case, providing evidence for the explainability of the case.
[0208] Embodiment eight
[0209] Furthermore, based on the above Figures 1 to 6 In one or more embodiments of the present specification, a storage medium is provided for storing computer-executable instruction information. In a specific embodiment, the storage medium may be a USB flash drive, an optical disk, a hard disk, etc. When the computer-executable instruction information stored in the storage medium is executed by a processor, the following process can be implemented:
[0210] Obtaining sample data for meta-learning, wherein the sample data includes features of corresponding events, sample label information, and a support set, wherein the support set includes multiple different event categories and supporting sample data corresponding to each event category;
[0211] Determining first category centers corresponding to different event categories in the support set based on the sample data, the attention weights corresponding to the supporting sample data of different event categories in the support set, and the number of supporting sample data of different event categories in the support set, and determining means of features corresponding to different event categories in the support set based on the sample data, and using the determined means as second category centers corresponding to different event categories in the support set;
[0212] Model training is performed on a target model applied to a credible scenario based on the first category centers corresponding to different event categories in the support set, the second category centers corresponding to different event categories in the support set, and the sample data to obtain a trained target model.
[0213] In an embodiment of this specification, determining the first category centers corresponding to different event categories in the support set based on the sample data, the preset attention weights corresponding to the supporting sample data of different event categories in the support set, and the number of supporting sample data of different event categories included in the support set includes:
[0214] Performing encoding processing on the supporting sample data corresponding to each event category in the support set in the sample data to obtain encoding features corresponding to each supporting sample data;
[0215] Based on the encoding features corresponding to each supporting sample data, the preset attention weights corresponding to the supporting sample data of different event categories in the support set, and the number of supporting sample data contained in different event categories in the support set, the first category centers corresponding to different event categories in the support set are determined.
[0216] In the embodiment of this specification, encoding the supporting sample data corresponding to each event category in the support set in the sample data to obtain the encoding features corresponding to each supporting sample data includes:
[0217] The support sample data corresponding to each event category in the support set in the sample data is encoded by a preset encoder to obtain an encoded feature corresponding to each support sample data, and the encoder is constructed based on an Encoder in a Transformer model.
[0218] In the embodiments of the present specification, the attention weight is determined based on the mean of the features corresponding to different event categories in the support set, the support sample data contained in the different event categories in the support set, a pre-set activation function, and a feedforward neural network.
[0219] In the embodiments of the present specification, the model training of the target model applied to the trusted scenario based on the first category center corresponding to different event categories in the support set, the second category center corresponding to different event categories in the support set, and the sample data comprises:
[0220] The distances between the sample data and the first category center corresponding to different event categories in the support set are calculated respectively, and the distances between the sample data and the second category center corresponding to different event categories in the support set are calculated respectively. The model training of the target model applied to the trusted scenario based on the calculated distances obtains a trained target model.
[0221] In the embodiments of the present specification, the event category includes one or more of a trusted category, a theft category, a fraud category, and an illegal financial activity category.
[0222] In the embodiments of the present specification, the method further comprises:
[0223] Obtaining business data generated by the first user performing a target business in the trusted scenario;
[0224] Obtaining the feature of the event corresponding to the business data, and encoding the feature of the event corresponding to the business data to obtain a target encoded feature;
[0225] Determining the event category corresponding to the business data based on the target encoded feature, and the first category center and the second category center of different event categories corresponding to the trained target model;
[0226] Based on the determined event category, performing risk prevention and control processing on the target business performed by the first user.
[0227] In the embodiments of the present specification, the method further comprises:
[0228] Receiving the first category center and the second category center of different event categories corresponding to the trained target model sent by the terminal device of the first user.
[0229] In the embodiments of the present specification, the following are also included:
[0230] deploying the trained target model in a terminal device of a second user;
[0231] When a preset update cycle is reached, an update support set corresponding to the trained target model is obtained, the update support set including a plurality of different event categories and support sample data corresponding to each event category;
[0232] The update support set is provided to the terminal device, and the update support set is used to trigger the terminal device to update the support set corresponding to the trained target model.
[0233] In another specific embodiment, the storage medium can be a U disk, an optical disk, a hard disk, etc. The computer executable instruction information stored in the storage medium, when executed by the processor, can implement the following processes:
[0234] receive the trained target model sent by the server, and determine the first category center and the second category center of different event categories corresponding to the trained target model, the trained target model being determined based on the sample data applied to meta-learning, the attention weight corresponding to the support sample data in the support set of different event categories in the sample data, and the number of support sample data contained in the support set of different event categories, the first category center corresponding to the support set of different event categories being determined, and the mean value of the features corresponding to the support set of different event categories being determined based on the sample data, the mean value being taken as the second category center corresponding to the support set of different event categories, the model being obtained after the model training based on the first category center corresponding to the support set of different event categories, the second category center corresponding to the support set of different event categories, and the sample data applied to the target model in a trusted scenario, the sample data including the features, sample label information, and support set corresponding to the event, the support set including a plurality of different event categories, and support sample data corresponding to each event category;
[0235] obtain business data generated by executing a target business in the trusted scenario;
[0236] obtain the features of the event corresponding to the business data, and perform encoding processing on the features of the event corresponding to the business data to obtain target encoded features, determine the event category corresponding to the business data based on the target encoded features and the first category center and the second category center of different event categories corresponding to the trained target model;
[0237] based on the determined event category, perform risk prevention and control processing on the target business executed by the first user.
[0238] In the embodiments of the present specification, the following are further included:
[0239] When a preset update period is reached, an update support set corresponding to the trained target model is obtained from the server, the update support set including a plurality of different event categories and support sample data corresponding to each event category;
[0240] The support set corresponding to the trained target model is updated based on the update support set.
[0241] The embodiments of the present specification provide a storage medium, by obtaining sample data applied to meta-learning, the sample data including features corresponding to events, sample label information and a support set, the support set including a plurality of different event categories and support sample data corresponding to each event category, then, based on the sample data, attention weights corresponding to the support sample data of different event categories in the support set, and the number of support sample data contained in different event categories in the support set, determining first category centers corresponding to different event categories in the support set, and based on the sample data, determining the mean of the features corresponding to different event categories in the support set as second category centers corresponding to different event categories, finally, based on the first category centers, the second category centers and the sample data, performing model training on a target model applied to a trusted scenario to obtain a trained target model, in this way, a trusted solution based on metric meta-learning is proposed, by calculating the user's local white prototype (i.e. the target model in the trusted environment), the user's daily transaction behavior pattern is described, and the effect of "near white, far black" is achieved through metric learning. In addition, new risks such as new risks of different event categories and new triggering methods under the same risk can be quickly iterated based on their features, without the need to backtrack the past full features, greatly improving the timeliness. In addition, the output result contains a comparison with the local white sample data itself, and the basis for trusted release is not only "far from global black" but also "near local white", which has certain explainability. After the model training is completed, the subsequent user's own features can be placed on the user's terminal device side, and the real-time calculation process can be completed on the user's terminal device side, and the cloud does not perceive the specific information of the user's past transactions, having the function of privacy protection.
[0242] In addition, it has the ability to quickly iterate and update for new risks, that is, when a new risk mode appears, it can be quickly supplemented to the user's support set Support Set through sampling and issued, and the corresponding category center is updated, which is much more efficient than model retraining. In addition, the model provides the output of the category center of the user's historical transaction local white features, which means the user's daily low-risk transaction behavior pattern, which can be traced back when a case occurs to calculate its similarity with the case, providing evidence for the explainability of the case.
[0243] The above described embodiments of the present description have been described. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order and still achieve desirable results. Additionally, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order, to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous or necessary.
[0244] In the 1990s, it was quite obvious to distinguish whether an improvement in a technology was in hardware (e.g., improvement in circuit structures of diodes, transistors, switches, etc.) or in software (improvement in method flow). However, as technology has evolved, many improvements in method flow today can be considered as direct improvements in hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structures by programming the improved method flow into hardware circuits. Therefore, it cannot be said that an improvement in a method flow cannot be implemented by hardware entity modules. For example, a programmable logic device (PLD) (e.g., a field programmable gate array (FPGA)) is an integrated circuit whose logic function is determined by user programming of the device. A digital system is "integrated" on a PLD by the designer programming it, rather than by asking a chip manufacturer to design and fabricate a custom integrated circuit chip. Moreover, instead of manually fabricating integrated circuit chips, this programming is now mostly implemented by "logic compiler" software, which is similar to software compilers used in program development, and the original code to be compiled is written in a specific programming language, which is called a hardware description language (HDL), and there are many such languages, 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., and the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should be aware that, as long as the method flow is logically programmed in the above-mentioned hardware description languages and programmed into an integrated circuit, a hardware circuit implementing the logical method flow can be easily obtained.
[0245] The controller can be implemented in any suitable way, e.g. the controller can take the form of a microprocessor or processor and a computer readable medium storing computer readable program code, e.g. software or firmware, executable by the (micro)processor, logic gates, switches, 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 AT91 SAM, 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 will also know that in addition to being implemented in pure computer readable program code form, the controller can perfectly well be implemented by means of logic programmed into logic gates, switches, application specific integrated circuits, programmable logic controllers and embedded microcontrollers, etc. to perform the same functions. The controller can thus be considered as a hardware component, and the means comprised therein for performing various functions can be considered as structures within the hardware component. Alternatively, or even, the means for performing various functions can be considered as both a software module implementing a method and a structure within a hardware component.
[0246] The systems, apparatuses, modules or units illustrated by the above embodiments can be implemented by computer chips or entities, or products with certain functions. A typical implementation device is a computer. Specifically, the computer can 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.
[0247] For the sake of description, the above apparatuses are described in various units with functions respectively. Of course, the functions of each unit can be implemented in the same or multiple software and / or hardware when implementing one or more embodiments of the present specification.
[0248] Those skilled in the art will understand that the embodiments of the present specification can be provided as a method, a system or a computer program product. Therefore, one or more embodiments of the present specification can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, one or more embodiments of the present specification can take the form of a computer program product implemented on one or more computer usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
[0249] The embodiments of the present specification are described with reference to flowcharts and / or block diagrams of the method, device (system) and computer program product according to the embodiments of the present specification. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor or other programmable electronic devices to produce a machine, so that the instructions executed by the computer or other programmable electronic devices generate a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions of one or more flows and / or blocks in the flowcharts and / or block diagrams can be implemented by an apparatus. Figure 1 The functions of one or more flows and / or blocks in the flowcharts and / or block diagrams can be implemented by an apparatus.
[0250] These computer program instructions can also be stored in a computer readable memory that can direct the computer or other programmable electronic devices to work in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including instruction apparatus, which implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions of one or more flows and / or blocks in the flowcharts and / or block diagrams can be implemented by an apparatus. Figure 1 The functions of one or more flows and / or blocks in the flowcharts and / or block diagrams can be implemented by an apparatus.
[0251] These computer program instructions can also be loaded into the computer or other programmable electronic devices, so that a series of operation steps are performed on the computer or other programmable electronic devices to produce a computer implemented process, so that the instructions executed on the computer or other programmable electronic devices provide steps for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions of one or more flows and / or blocks in the flowcharts and / or block diagrams can be implemented by an apparatus. Figure 1 The functions of one or more flows and / or blocks in the flowcharts and / or block diagrams can be implemented by an apparatus.
[0252] In a typical configuration, the computing device includes one or more processors (CPU), input / output interface, network interface and memory.
[0253] The memory can include non-persistent memory in the computer readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer readable media.
[0254] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. The 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 technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.
[0255] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusion, such that processes, methods, articles or devices that comprise a list of elements do not only include those elements, but also other elements not explicitly listed or other elements inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or device that includes the element.
[0256] Those skilled in the art will appreciate that embodiments of the present specification can be provided as methods, systems or computer program products. Therefore, one or more embodiments of the present specification can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, one or more embodiments of the present specification can 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.
[0257] One or more embodiments of the present specification can be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. One or more embodiments of the present specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are connected through a communication network. In a distributed computing environment, program modules can be located in both local and remote computer storage media including storage devices.
[0258] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each of the embodiments focuses on the difference from other embodiments. In particular, for the system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiments.
[0259] The above only describes the embodiments of the specification and is not used to limit the application. The specification can have various changes and modifications for those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the specification shall be included in the scope of claims of the specification.
Claims
1. A method for processing a model, the method comprising: Obtaining payment service-related business data for meta-learning, wherein the payment service-related business data includes features of corresponding events, sample label information, and a support set, wherein the support set includes multiple different event categories and supporting sample data corresponding to each event category; Determining first category centers corresponding to different event categories in the support set based on the business data related to the payment business, the attention weights corresponding to the supporting sample data of different event categories in the support set, and the number of supporting sample data contained in different event categories in the support set; and determining means of features corresponding to different event categories in the support set based on the business data related to the payment business, and using the determined means as second category centers corresponding to different event categories in the support set; Based on the first category center corresponding to different event categories in the support set, the second category center corresponding to different event categories in the support set and the business data related to the payment business, the target model applied in the trusted scenario is trained to obtain a trained target model.
2. The method according to claim 1, wherein determining first category centers corresponding to different event categories in the support set based on the business data related to the payment business, preset attention weights corresponding to the supporting sample data of different event categories in the support set, and the number of supporting sample data of different event categories in the support set comprises: performing encoding processing on supporting sample data corresponding to each event category in the support set in the business data related to the payment business to obtain encoding features corresponding to each supporting sample data; Based on the encoding features corresponding to each supporting sample data, the preset attention weights corresponding to the supporting sample data of different event categories in the support set, and the number of supporting sample data contained in different event categories in the support set, the first category centers corresponding to different event categories in the support set are determined.
3. The method according to claim 2, wherein encoding the supporting sample data corresponding to each event category in the support set in the business data related to the payment business to obtain the encoding features corresponding to each supporting sample data comprises: The supporting sample data corresponding to each event category in the support set of the business data related to the payment business is encoded by a preset encoder to obtain the encoding features corresponding to each supporting sample data. The encoder is constructed based on the Encoder in the Transformer model.
4. According to the method of claim 2, the attention weight is based on the business data related to the payment business, the mean of the features corresponding to different event categories in the support set, and is determined by a feedforward neural network and a preset activation function, as well as the number of supporting sample data contained in different event categories in the support set.
5. The method according to claim 1, wherein the training of a target model applied to a trusted scenario based on the first category centers corresponding to different event categories in the support set, the second category centers corresponding to different event categories in the support set, and the business data related to the payment business to obtain the trained target model comprises: The distances between the business data related to the payment business and the first category centers corresponding to different event categories in the support set are calculated respectively, and the distances between the business data related to the payment business and the second category centers corresponding to different event categories in the support set are calculated respectively. Based on the calculated distances, model training is performed on the target model applied to the trusted scenario to obtain the trained target model. 6 . The method according to claim 1 , wherein the event category comprises one or more of a trustworthy category, an embezzlement category, a fraud category, and an illegal financial activity category.
7. The method according to claim 1, further comprising: Acquire business data generated by the first user executing the target business in the trusted scenario; Acquiring features of the event corresponding to the business data, and encoding the features of the event corresponding to the business data to obtain target encoding features; Determining the event category corresponding to the business data based on the target coding feature and the first category center and the second category center of different event categories corresponding to the trained target model; Based on the determined event category, risk prevention and control processing is performed on the target business executed by the first user.
8. The method according to claim 7, further comprising: Receive the first category center and the second category center of different event categories corresponding to the trained target model sent by the terminal device of the first user.
9. The method according to claim 1, further comprising: Deploying the trained target model in a terminal device of a second user; When a preset update cycle is reached, an updated support set corresponding to the trained target model is obtained, wherein the updated support set includes a plurality of different event categories and supporting sample data corresponding to each event category; The updated support set is provided to the terminal device, where the updated support set is used to trigger the terminal device to update the support set corresponding to the trained target model.
10. A risk prevention and control method, comprising: Receive a trained target model sent by a server, and determine first category centers and second category centers of different event categories corresponding to the trained target model, wherein the trained target model is based on sample data applied to meta-learning, attention weights corresponding to support sample data of different event categories in a support set in the sample data, and the number of support sample data of different event categories contained in the support set, to determine first category centers corresponding to different event categories in the support set, and based on the sample data, determine the mean of features corresponding to different event categories in the support set, and use the determined mean as the second category centers corresponding to different event categories in the support set, and perform model training on the target model applied to a trusted scenario based on the first category centers corresponding to different event categories in the support set, the second category centers corresponding to different event categories in the support set, and the sample data, wherein the sample data includes features of corresponding events, sample label information, and a support set, and the support set includes multiple different event categories and support sample data corresponding to each event category; Acquire business data generated by executing the target business in the trusted scenario; Acquiring features of events corresponding to the business data, encoding the features of the events corresponding to the business data to obtain target encoding features, and determining the event category corresponding to the business data based on the target encoding features and first category centers and second category centers of different event categories corresponding to the trained target model; Based on the determined event category, risk prevention and control processing is performed on the target business executed by the first user.
11. The method according to claim 10, further comprising: When a preset update cycle is reached, an updated support set corresponding to the trained target model is obtained from the server, wherein the updated support set includes a plurality of different event categories and supporting sample data corresponding to each event category; The support set corresponding to the trained target model is updated based on the updated support set.
12. A model processing device, comprising: A sample acquisition module acquires payment-related business data for meta-learning, wherein the payment-related business data includes features of corresponding events, sample label information, and a support set. The support set includes multiple different event categories and supporting sample data corresponding to each event category. a category center determination module, which determines first category centers corresponding to different event categories in the support set based on the business data related to the payment business, the attention weights corresponding to the supporting sample data of different event categories in the support set, and the number of supporting sample data contained in different event categories in the support set, and determines the mean of the features corresponding to different event categories in the support set based on the business data related to the payment business, and uses the determined mean as the second category center corresponding to different event categories in the support set; The training module performs model training on the target model applied in the trusted scenario based on the first category center corresponding to different event categories in the support set, the second category center corresponding to different event categories in the support set, and the business data related to the payment business to obtain a trained target model.
13. A risk prevention and control processing device, comprising: A model deployment module receives a trained target model sent by a server, and determines first category centers and second category centers of different event categories corresponding to the trained target model, wherein the trained target model is based on sample data applied to meta-learning, attention weights corresponding to support sample data of different event categories in a support set in the sample data, and the number of support sample data of different event categories contained in the support set, determines the first category centers corresponding to different event categories in the support set, and based on the sample data, determines the mean of features corresponding to different event categories in the support set, and uses the determined mean as the second category centers corresponding to different event categories in the support set, and a model obtained after model training is performed on the target model applied to a trusted scenario based on the first category centers corresponding to different event categories in the support set, the second category centers corresponding to different event categories in the support set, and the sample data, wherein the sample data includes features of the corresponding event, sample label information, and a support set, and the support set includes multiple different event categories, and support sample data corresponding to each event category; A business data acquisition module, which acquires business data generated by executing the target business in the trusted scenario; a category determination module, which obtains features of the event corresponding to the business data, encodes the features of the event corresponding to the business data to obtain target encoding features, and determines the event category corresponding to the business data based on the target encoding features and the first category center and the second category center of different event categories corresponding to the trained target model; The risk prevention and control module performs risk prevention and control on the target business executed by the first user based on the determined event category.
14. A model processing device, comprising: processor; as well as a memory arranged to store computer-executable instructions which, when executed, cause the processor to: Obtaining payment service-related business data for meta-learning, wherein the payment service-related business data includes features of corresponding events, sample label information, and a support set, wherein the support set includes multiple different event categories and supporting sample data corresponding to each event category; Determining first category centers corresponding to different event categories in the support set based on the business data related to the payment business, the attention weights corresponding to the supporting sample data of different event categories in the support set, and the number of supporting sample data contained in different event categories in the support set; and determining means of features corresponding to different event categories in the support set based on the business data related to the payment business, and using the determined means as second category centers corresponding to different event categories in the support set; Based on the first category center corresponding to different event categories in the support set, the second category center corresponding to different event categories in the support set and the business data related to the payment business, the target model applied in the trusted scenario is trained to obtain a trained target model.
15. A model processing device, comprising: processor; as well as a memory arranged to store computer-executable instructions which, when executed, cause the processor to: Receive a trained target model sent by a server, and determine first category centers and second category centers of different event categories corresponding to the trained target model, wherein the trained target model is based on sample data applied to meta-learning, attention weights corresponding to support sample data of different event categories in a support set in the sample data, and the number of support sample data of different event categories contained in the support set, to determine first category centers corresponding to different event categories in the support set, and based on the sample data, determine the mean of features corresponding to different event categories in the support set, and use the determined mean as the second category centers corresponding to different event categories in the support set, and perform model training on the target model applied to a trusted scenario based on the first category centers corresponding to different event categories in the support set, the second category centers corresponding to different event categories in the support set, and the sample data, wherein the sample data includes features of corresponding events, sample label information, and a support set, and the support set includes multiple different event categories and support sample data corresponding to each event category; Acquire business data generated by executing the target business in the trusted scenario; Acquiring features of events corresponding to the business data, encoding the features of the events corresponding to the business data to obtain target encoding features, and determining the event category corresponding to the business data based on the target encoding features and first category centers and second category centers of different event categories corresponding to the trained target model; Based on the determined event category, risk prevention and control processing is performed on the target business executed by the first user.
16. A storage medium for storing computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the following process: Obtaining payment service-related business data for meta-learning, wherein the payment service-related business data includes features of corresponding events, sample label information, and a support set, wherein the support set includes multiple different event categories and supporting sample data corresponding to each event category; Determining first category centers corresponding to different event categories in the support set based on the business data related to the payment business, the attention weights corresponding to the supporting sample data of different event categories in the support set, and the number of supporting sample data contained in different event categories in the support set; and determining means of features corresponding to different event categories in the support set based on the business data related to the payment business, and using the determined means as second category centers corresponding to different event categories in the support set; Based on the first category center corresponding to different event categories in the support set, the second category center corresponding to different event categories in the support set and the business data related to the payment business, the target model applied in the trusted scenario is trained to obtain a trained target model.
17. A storage medium for storing computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the following process: Receive a trained target model sent by a server, and determine first category centers and second category centers of different event categories corresponding to the trained target model, wherein the trained target model is based on sample data applied to meta-learning, attention weights corresponding to support sample data of different event categories in a support set in the sample data, and the number of support sample data of different event categories contained in the support set, to determine first category centers corresponding to different event categories in the support set, and based on the sample data, determine the mean of features corresponding to different event categories in the support set, and use the determined mean as the second category centers corresponding to different event categories in the support set, and perform model training on the target model applied to a trusted scenario based on the first category centers corresponding to different event categories in the support set, the second category centers corresponding to different event categories in the support set, and the sample data, wherein the sample data includes features of corresponding events, sample label information, and a support set, and the support set includes multiple different event categories and support sample data corresponding to each event category; Acquire business data generated by executing the target business in the trusted scenario; Acquiring features of events corresponding to the business data, encoding the features of the events corresponding to the business data to obtain target encoding features, and determining the event category corresponding to the business data based on the target encoding features and first category centers and second category centers of different event categories corresponding to the trained target model; Based on the determined event category, risk prevention and control processing is performed on the target business executed by the first user.
Citation Information
Patent Citations
Model training method and device based on risk identification and electronic equipment
CN111932041A
Model training method and device, text classification method, computer equipment and medium
CN112256874A