Method, apparatus and electronic device for determining dangerous attribute of user data
By introducing a bidirectional attention mechanism into the encoder-decoder structure and integrating the hidden states of time and feature space, the problem of insufficient accuracy in user data judgment in existing technologies is solved, and more efficient identification of dangerous attributes of user data is achieved.
Patent Information
- Application Number
- CN202080094382.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-22
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2040-04-22
AI Technical Summary
Existing methods for determining dangerous attributes of user data cannot effectively integrate the cross-information of time and feature dimensions when processing long sequences, resulting in insufficient accuracy.
A bidirectional attention mechanism is embedded in the encoder-decoder structure to integrate the hidden states in the temporal and feature spaces, and the judgment accuracy is improved by using a bidirectional attention matrix.
It improves the accuracy of determining the dangerous attributes of user data, enabling more accurate identification of the danger of user behavior and preventing potential black market activities.
Smart Images

Figure CN115066699B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic equipment technology, and more specifically, to a method, apparatus, and electronic equipment for determining the dangerous attributes of user data. Background Technology
[0002] In the past two years, my country has vigorously developed inclusive finance, which has led to the rapid development of the internet finance industry. While achieving inclusiveness, it has also provided black market operators with more convenient, faster, and lower-cost means of committing crimes, putting considerable pressure on relevant internet finance institutions. Summary of the Invention
[0003] In view of the above problems, this application proposes a method, apparatus, and electronic device for determining the dangerous attributes of user data to solve the above problems.
[0004] In a first aspect, embodiments of this application provide a method for determining the dangerous attributes of user data. The method includes: acquiring user data, the user data including time data and feature data with a corresponding relationship; encoding the user data to obtain encoded data of the user data, the encoded data including a temporal-space hidden state and a feature-space hidden state; calculating the temporal-space hidden state and the feature-space hidden state based on a bidirectional attention mechanism to obtain a bidirectional attention matrix; generating data to be decoded based on the bidirectional attention matrix and the encoded data; decoding the data to be decoded to obtain decoded data of the user data, and determining the dangerous attributes of the user data based on the decoded data.
[0005] Secondly, embodiments of this application provide a device for determining the dangerous attributes of user data. The device includes: a user data acquisition module for acquiring user data, the user data including time data and feature data with corresponding relationships; an encoded data acquisition module for encoding the user data to obtain encoded data of the user data, the encoded data including temporal-space hidden states and feature-space hidden states; a bidirectional attention matrix acquisition module for calculating the temporal-space hidden states and the feature-space hidden states based on a bidirectional attention mechanism to obtain a bidirectional attention matrix; a data to be decoded generation module for generating data to be decoded based on the bidirectional attention matrix and the encoded data; and a dangerous attribute determination module for decoding the data to be decoded to obtain decoded data of the user data, and determining the dangerous attributes of the user data based on the decoded data.
[0006] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory is coupled to the processor, the memory stores instructions, and when the instructions are executed by the processor, the processor performs the above-described method.
[0007] Fourthly, embodiments of this application provide a computer-readable storage medium storing program code, which can be invoked by a processor to execute the above-described method.
[0008] The present application provides a method, apparatus, and electronic device for determining the dangerous attributes of user data. The method acquires user data, which includes time data and feature data with corresponding relationships. The user data is encoded to obtain encoded data, which includes temporal-space latent states and feature-space latent states. Based on a bidirectional attention mechanism, the temporal-space latent states and feature-space latent states are calculated to obtain a bidirectional attention matrix. Based on the bidirectional attention matrix and the encoded data, data to be decoded is generated. The data to be decoded is decoded to obtain decoded data of the user data. The dangerous attributes of the user data are determined based on the decoded data. This method embeds a bidirectional attention mechanism into the encoding-decoding structure to mine dangerous attributes of user data, integrating the temporal-space latent states and feature-space latent states to represent attention, thereby improving the accuracy of dangerous attribute determination for user data. Attached Figure Description
[0009] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 A flowchart illustrating a method for determining the dangerous attributes of user data according to an embodiment of this application is shown.
[0011] Figure 2 This illustration shows a schematic diagram of the encoding and decoding of user data provided in an embodiment of this application;
[0012] Figure 3 A flowchart illustrating a method for determining the dangerous attributes of user data according to another embodiment of this application is shown;
[0013] Figure 4 This application shows Figure 3 The flowchart shown is a step S203 of the method for determining the dangerous attributes of user data.
[0014] Figure 5 This application shows Figure 3 The flowchart shown is a step S204 of the method for determining the dangerous attributes of user data.
[0015] Figure 6 This application shows Figure 3 The flowchart shown is a step S205 of the method for determining the dangerous attributes of user data.
[0016] Figure 7 A flowchart illustrating a method for determining the dangerous attributes of user data according to another embodiment of this application is shown;
[0017] Figure 8 This invention illustrates a block diagram of a device for determining the hazardous attributes of user data provided in an embodiment of this application.
[0018] Figure 9 A block diagram of an electronic device for performing a method for determining the dangerous attributes of user data according to an embodiment of this application is shown;
[0019] Figure 10 A storage unit for storing or carrying program code implementing a method for determining the dangerous attributes of user data according to an embodiment of this application is shown. Detailed Implementation
[0020] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0021] In the past two years, my country has vigorously developed inclusive finance, leading to the rapid development of the internet finance industry. While achieving financial inclusion, this has also provided black market operators with more convenient, faster, and lower-cost methods of committing crimes, putting considerable pressure on relevant internet finance institutions. Building a risk control system based on blacklist strategies is the first step, effectively preventing attacks from non-cold-start black market operators through correlation. In identifying risks from cold-start users, risk control models based on both static user information (such as device, environment, location-based services (LBS) information, application software (APP) usage, etc.) and dynamic information (such as user behavior series) play a crucial role. In recent years, due to the rapid development of research in the field of natural language processing (NLP) and the successful implementation of cases, the application of sequence models has gained attention. More and more financial institutions hope to use user behavior series data modeling to uncover more black market users that cannot be captured by blacklists and static models.
[0022] Current behavioral sequence models fall into two main categories: 1) behavioral sequence models based on nonlinear autoregressive models (NARX), such as recurrent neural networks (RNNs) and their variants, long short-term memory networks (LSTM) and gated recurrent units (GRUs); 2) models that, based on NARX, introduce attention mechanisms to control the degree of dependence of labels on different inputs. However, the inventors have found that for the first category, behavioral sequence models based on nonlinear autoregressive models are usually modeled using an encoder-decoder approach. Data is encoded into hidden states by the encoder, then decoded by the decoder, and finally mapped to labels through corresponding fully connected layers and softmax. However, as the behavioral sequence becomes longer, relying solely on hidden states for information transmission cannot explicitly represent global information. For category 2), because NARX-type models are insufficient for processing long sequences, attention-based models have received more attention because they can perceive global information. Attention mechanisms are a type of algorithm embedded in neural networks to determine different input weights. Although attention mechanisms have a global perspective, current attention-based models can only model from the time dimension or feature dimension alone, thus ignoring the information of behavioral series in the time-feature intersection dimension.
[0023] To address the aforementioned problems, the inventors, through long-term research, discovered and proposed the method, apparatus, and electronic device for determining the dangerous attributes of user data provided in the embodiments of this application. This method utilizes a bidirectional attention mechanism embedded in the encoder-decoder structure to mine the dangerous attributes of user data, integrating the latent states in the temporal and spatial dimensions and the latent states in the feature space to represent attention, thereby improving the accuracy of determining the dangerous attributes of user data. The specific method for determining the dangerous attributes of user data will be described in detail in subsequent embodiments.
[0024] Please see Figure 1 , Figure 1 This illustration shows a flowchart of a method for determining the dangerous attributes of user data according to an embodiment of this application. The method uses a bidirectional attention mechanism embedded in an encoder-decoder structure to mine dangerous attributes of user data, integrating the latent states in the temporal and spatial domains and the latent states in the feature space to represent the attention, thereby improving the accuracy of determining the dangerous attributes of user data. In a specific embodiment, the method for determining the dangerous attributes of user data is applied to, for example... Figure 8 The illustrated device 200 for determining the dangerous attributes of user data and the electronic device 100 configured with the device 200 for determining the dangerous attributes of user data are shown. Figure 9The following will use an electronic device as an example to illustrate the specific process of this embodiment. Of course, it is understood that the electronic device used in this embodiment can be a smartphone, tablet computer, wearable electronic device, etc., and is not limited thereto. The following section will focus on... Figure 1 The process shown will be described in detail. The method for determining the dangerous attributes of user data may specifically include the following steps:
[0025] Step S101: Obtain user data, which includes time data and feature data that have a corresponding relationship.
[0026] In this embodiment, user data can be acquired, which can be acquired in real time, at preset time intervals, at specified times, or according to other preset rules, etc., without limitation. In some embodiments, user data can be acquired locally from the electronic device (the electronic device pre-records and stores user data), or from a server connected to the electronic device (the server pre-records and stores user data), etc., without limitation.
[0027] In some implementations, user data includes time data and feature data that have a corresponding relationship. The time data can be based on a monthly, weekly, daily, or hourly time period, etc. For example, when the time data is based on a monthly time period, the user data can include feature data within a certain month; when the time data is based on a weekly time period, the user data can include feature data within a certain week; when the time data is based on a daily time period, the user data can include feature data within a certain day; when the user data is based on an hourly time period, the user data can include feature data within a certain time period, etc., without limitation.
[0028] In some implementations, feature data may include attribute data, behavioral data, etc. Attribute data may include, but is not limited to, age data, gender data, geographic location data, and hobby data. Behavioral data may include, but is not limited to, login data, browsing data, click data, redirect data, payment data, and rating data. In this embodiment, the acquired user data may include: the user's age, gender, geographic location data, hobby data, login data, browsing data, click data, redirect data, payment data, and rating data within a specific time period; and the user's age, gender, geographic location data, hobby data, login data, browsing data, click data, redirect data, payment data, and rating data within a specific month, etc., without limitation.
[0029] Step S102: Encode the user data to obtain encoded data of the user data, the encoded data including temporal spatial hidden states and feature space hidden states.
[0030] In this embodiment, after acquiring user data, the user data can be encoded to obtain encoded data. The obtained encoded data may include temporal-space latent states and feature-space latent states. Please refer to [link to relevant documentation]. Figure 2 , Figure 2 This application provides a schematic diagram of the encoding and decoding of user data, as illustrated in an embodiment. Figure 2 As shown, in some implementations, user data is encoded, and the encoded data output during the encoding process is the hidden state of an RNN. Where T represents the sequence length and M represents the length of the hidden state. The identifier is a coded data hidden state with a sequence length of T and a hidden state length of M, wherein... Indicates all channels at t th The hidden state at time step, i.e., the hidden state in the feature space. Indicates the m-th th The hidden states of a channel at all points in time, i.e., the spatiotemporal hidden states, such as Figure 2 As shown in A in the diagram.
[0031] Step S103: Based on the bidirectional attention mechanism, calculate the temporal-space hidden state and the feature-space hidden state to obtain the bidirectional attention matrix.
[0032] In this embodiment, after obtaining the temporal-space hidden state and the feature-space hidden state, a bidirectional attention matrix can be obtained by calculating the temporal-space hidden state and the feature-space hidden state based on a bidirectional attention mechanism. In some embodiments, after obtaining the temporal-space hidden state and the feature-space hidden state, a first weighted calculation can be performed on the temporal-space hidden state, and a second weighted calculation can be performed on the feature-space hidden state based on a bidirectional attention mechanism to obtain the bidirectional attention matrix. In some embodiments, after obtaining the temporal-space hidden state and the feature-space hidden state, a weighted calculation can be performed on the temporal-space hidden state and the feature-space hidden state based on a bidirectional attention mechanism, and label mapping can be performed through a corresponding fully connected layer and softmax to obtain the bidirectional attention matrix.
[0033] Step S104: Generate data to be decoded based on the bidirectional attention matrix and the encoded data.
[0034] In this embodiment, after obtaining the bidirectional attention matrix and encoded data, data to be decoded can be generated based on the bidirectional attention matrix and encoded data. In some embodiments, after obtaining the bidirectional attention matrix and encoded data, calculations can be performed on the bidirectional attention matrix and encoded data to obtain the data to be decoded.
[0035] Step S105: Decode the data to be decoded to obtain the decoded data of the user data, and determine the dangerous attributes of the user data based on the decoded data.
[0036] In this embodiment, after generating the data to be decoded, the data can be decoded to obtain decoded user data, and the dangerous attributes of the user data can be determined based on the decoded data. The bidirectional attention mechanism, by integrating temporal and feature space information, extends the global perspective of the attention mechanism, thereby more accurately mapping label information from different features at the same time and the same feature series at different times to obtain decoded data. This makes the dangerous attributes of the user data determined based on the decoded data more accurate.
[0037] In some implementations, determining the danger attribute of user data based on decoded data can mean determining that the user data is dangerous or not dangerous. In some implementations, determining the danger attribute of user data based on decoded data can mean determining the danger level of user data based on decoded data, for example, determining the danger level of user data as high, moderately high, moderate, moderately low, or low, etc., without limitation.
[0038] One embodiment of this application provides a method for determining the dangerous attributes of user data. The method involves acquiring user data, which includes corresponding temporal data and feature data. The user data is encoded to obtain encoded data, which includes temporal-space latent states and feature-space latent states. Based on a bidirectional attention mechanism, the temporal-space latent states and feature-space latent states are calculated to obtain a bidirectional attention matrix. Based on the bidirectional attention matrix and the encoded data, data to be decoded is generated. The data to be decoded is then decoded to obtain decoded data of the user data. Based on the decoded data, the dangerous attributes of the user data are determined. This method improves the accuracy of determining the dangerous attributes of user data by integrating the temporal-space latent states and feature-space latent states into a representation of attention, thereby embedding a bidirectional attention mechanism into the encoding-decoding structure.
[0039] Please see Figure 3 , Figure 3 This illustration shows a flowchart of a method for determining the dangerous attributes of user data according to another embodiment of this application. The following will focus on... Figure 3 The process shown will be described in detail. The method for determining the dangerous attributes of user data may specifically include the following steps:
[0040] Step S201: Obtain user data, which includes time data and feature data that have a corresponding relationship.
[0041] Step S202: Encode the user data to obtain encoded data of the user data, the encoded data including temporal spatial hidden states and feature space hidden states.
[0042] For a detailed description of steps S201-S202, please refer to steps S101-S102, which will not be repeated here.
[0043] Step S203: Based on the bidirectional attention mechanism, calculate the temporal and spatial hidden states to obtain the first fully connected layer.
[0044] In this embodiment, after obtaining the spatiotemporal hidden state, the spatiotemporal hidden state can be calculated based on a bidirectional attention mechanism to obtain the first fully connected layer, such as... Figure 2 As shown in B in the diagram.
[0045] Please see Figure 4 , Figure 4 This application shows Figure 3 The flowchart shown illustrates step S203 of the method for determining the dangerous attributes of user data. The following will address... Figure 4 The process shown will be described in detail, and the method may specifically include the following steps:
[0046] Step S2031: Obtain the first weight coefficient matrix.
[0047] In this embodiment, after obtaining the temporal and spatial hidden states, a first weight coefficient matrix can be obtained based on a bidirectional attention mechanism. This first weight coefficient matrix can be learned during the training process. In some implementations, the first weight coefficient matrix can be obtained during training and stored locally on the electronic device, and then retrieved directly from the local storage of the electronic device after obtaining the temporal and spatial hidden states. In another implementation, the first weight coefficient matrix can be obtained during training and stored on a server connected to the electronic device's communication network, and then retrieved from the server via a wireless network or data network after obtaining the temporal and spatial hidden states.
[0048] Step S2032: Calculate the first weight coefficient matrix and the temporal hidden state to obtain the first fully connected layer.
[0049] In this embodiment, after obtaining the first weight coefficient matrix, the first weight coefficient matrix and the temporal-space hidden states can be calculated to obtain the first fully connected layer. In some implementations, it can be based on... The first weight coefficient matrix and the temporal hidden state are calculated to obtain the first fully connected layer α. t Among them, W α This is the first weight coefficient matrix. This represents the temporal and spatial hidden states. In some implementations, the first weighting coefficient matrix is...
[0050] Step S204: Based on the bidirectional attention mechanism, calculate the hidden state of the feature space to obtain the second fully connected layer.
[0051] In this embodiment, after obtaining the hidden states in the feature space, the hidden states can be calculated based on a bidirectional attention mechanism to obtain the second fully connected layer, such as... Figure 2 As shown in C.
[0052] Please see Figure 5 , Figure 5 This application shows Figure 3 The flowchart shown illustrates step S204 of the method for determining the dangerous attributes of user data. The following will address... Figure 5 The process shown will be described in detail, and the method may specifically include the following steps:
[0053] Step S2041: Obtain the second weight coefficient matrix.
[0054] In this embodiment, after obtaining the hidden state of the feature space, a second weight coefficient matrix can be obtained based on a bidirectional attention mechanism. This second weight coefficient matrix can be learned during the training process. In some implementations, the second weight coefficient matrix can be obtained during training and stored locally on the electronic device, and then retrieved directly from the local storage of the electronic device after obtaining the hidden state of the feature space. In another implementation, the second weight coefficient matrix can be obtained during training and stored on a server connected to the electronic device's communication network, and then retrieved from the server via a wireless network or data network after obtaining the hidden state of the feature space.
[0055] Step S2042: Calculate the second weight coefficient matrix and the hidden state in the feature space to obtain the second fully connected layer.
[0056] In this embodiment, after obtaining the second weight coefficient matrix, the second weight coefficient matrix and the hidden states in the feature space can be calculated to obtain the second fully connected layer. In some implementations, it can be based on β. m =W β h m The second weight coefficient matrix and the hidden states in the feature space are calculated to obtain the second fully connected layer β. m Among them, W β h is the second weighting coefficient matrix. m This represents the hidden state in the feature space. In some implementations, the second weighting coefficient matrix is...
[0057] Step S205: Calculate the first fully connected layer and the second fully connected layer to obtain the bidirectional attention matrix.
[0058] In this embodiment, after obtaining the first fully connected layer and the second fully connected layer, the bidirectional attention matrix can be calculated from the first and second fully connected layers, such as... Figure 2 As shown in D in the diagram.
[0059] Please see Figure 6 , Figure 6 This application shows Figure 3 The flowchart shown illustrates step S205 of the method for determining the dangerous attributes of user data. The following will address... Figure 6 The process shown will be described in detail, and the method may specifically include the following steps:
[0060] Step S2051: Obtain the weight coefficient vector.
[0061] In this embodiment, after obtaining the first and second fully connected layers, a weight coefficient vector can be obtained based on a bidirectional attention mechanism. This weight coefficient vector can be learned during training. In some implementations, the weight coefficient vector can be obtained during training and stored locally on the electronic device, and then retrieved directly from the local storage of the electronic device after obtaining the first and second fully connected layers. In another implementation, the weight coefficient vector can be obtained during training and stored on a server connected to the electronic device's communication network, and then retrieved from the server via a wireless network or data network after obtaining the first and second fully connected layers.
[0062] Step S2052: Calculate the weight coefficient vector, the first fully connected layer, and the second fully connected layer to obtain the bidirectional attention matrix.
[0063] In this embodiment, after obtaining the weight coefficient vector, the weight coefficient vector, the first fully connected layer, and the second fully connected layer can be calculated to obtain the bidirectional attention matrix. In some implementations, it can be based on r t m =W r tanh(α t +β m The bidirectional attention matrix r is obtained by calculating the weight coefficient vector, the first fully connected layer, and the second fully connected layer. t m Among them, W r Let α be the weight coefficient vector. t For the first fully connected layer, β m This is the second fully connected layer. In some implementations, the weight coefficient vector is...
[0064] In this embodiment, it is precisely because of the bidirectional attention matrix r t m It also integrates the first fully connected layer α t Second fully connected layer β m Therefore, the bidirectional attention matrix r t m It possesses distribution information in both the temporal and feature spaces, i.e., the bidirectional attention matrix r t m The information it reflects is more accurate.
[0065] Step S206: Process the bidirectional attention matrix based on the softmax function to obtain the probability matrix.
[0066] In this embodiment, after obtaining the bidirectional attention matrix, it can be processed using the softmax function to obtain the probability matrix. Specifically, to ensure that the sum of all attention weights within the same channel is 1, the bidirectional attention matrix can be processed using the softmax function to obtain the probability matrix. In some implementations, it can be based on... The probability matrix s is obtained by calculating the bidirectional attention matrix. t m , where r t m This is a bidirectional attention matrix.
[0067] Step S207: Generate the data to be decoded based on the probability matrix and the encoded data.
[0068] In some implementations, after obtaining the probability matrix and encoded data, it is possible to base it on... The probability matrix and encoded data are calculated to obtain the data to be decoded. in, For probability data, For encoded data.
[0069] Step S208: Decode the data to be decoded to obtain the decoded data of the user data, and determine the dangerous attributes of the user data based on the decoded data.
[0070] For a detailed description of step S208, please refer to step S105, which will not be repeated here.
[0071] Another embodiment of this application provides a method for determining the dangerous attributes of user data. The method involves acquiring user data, which includes corresponding temporal data and feature data; encoding the user data to obtain encoded data, which includes temporal-space hidden states and feature-space hidden states; calculating the temporal-space hidden states based on a bidirectional attention mechanism to obtain a first fully connected layer; calculating the feature-space hidden states based on the same bidirectional attention mechanism to obtain a second fully connected layer; calculating the first and second fully connected layers to obtain a bidirectional attention matrix; processing the bidirectional attention matrix using a softmax function to obtain a probability matrix; generating data to be decoded based on the probability matrix and the encoded data; decoding the data to be decoded to obtain decoded user data; and determining the dangerous attributes of the user data based on the decoded data. Compared to... Figure 1 The method for determining the dangerous attributes of user data shown in this embodiment further calculates the temporal and spatial hidden states and the feature space hidden states respectively to obtain two different fully connected layers, and obtains a bidirectional attention matrix based on the two different fully connected layers to improve the accuracy of determining the dangerous attributes of user data.
[0072] Please see Figure 7 , Figure 7 A flowchart illustrating a method for determining the dangerous attributes of user data according to another embodiment of this application is shown. The following will focus on... Figure 7 The process shown will be described in detail. The method for determining the dangerous attributes of user data may specifically include the following steps:
[0073] Step S301: Obtain user data, which includes time data and feature data that have a corresponding relationship.
[0074] Step S302: Encode the user data to obtain encoded data of the user data, the encoded data including temporal spatial hidden states and feature space hidden states.
[0075] Step S303: Based on the bidirectional attention mechanism, calculate the temporal-space hidden state and the feature-space hidden state to obtain the bidirectional attention matrix.
[0076] Step S304: Generate data to be decoded based on the bidirectional attention matrix and the encoded data.
[0077] Step S305: Decode the data to be decoded to obtain the decoded data of the user data.
[0078] For a detailed description of steps S301-S305, please refer to steps S101-S105, which will not be repeated here.
[0079] Step S306: When the decoded data is the first data, determine that the dangerous attribute of the user data is dangerous.
[0080] In some implementations, first data and second data can be preset. The first data can be used to characterize the dangerous attribute of the user data corresponding to the decoded data as dangerous, and the second data can be used to characterize the dangerous attribute of the user data corresponding to the interface data as not dangerous. For example, the first data can be "1" and the second data can be "0".
[0081] In some implementations, after obtaining the decoded data, it can be compared with first data and second data to determine whether the decoded data is the first data or the second data. Specifically, if the comparison result indicates that the decoded data is the first data, for example, if the decoded data is determined to be "1", the user attribute of the user data corresponding to the decoded data can be determined to be dangerous.
[0082] Step S307: When an information request corresponding to the user data is received, the information request is rejected.
[0083] In some implementations, when the attribute information of the user data is determined to be dangerous, indicating that the operation performed by the user is a dangerous operation or the user's behavior is a dangerous behavior, the information request corresponding to the user data is rejected upon receipt, so as to avoid the occurrence of dangerous operation or dangerous behavior.
[0084] Step S308: Issue an alarm notification and add the user data to the blacklist.
[0085] In some implementations, when the attribute information of the user data is determined to be dangerous, indicating that the user's operation or behavior is dangerous, an alarm message can be issued to prompt appropriate defensive actions against the user data. This alarm message may include voice alarm messages, text alarm messages, image alarm messages, etc. Furthermore, the alarm message can be directly output on the electronic device or sent to a server via the electronic device; no limitation is made here.
[0086] In some implementations, when the attribute information of user data is determined to be dangerous, indicating that the user's operation or behavior is dangerous, the user data can be added to a blacklist to directly reject any operation performed by that user data, thus preventing dangerous operations or behaviors from occurring. In some implementations, when the attribute information of user data is determined to be dangerous, the number of times the attribute information of the user data has been deemed dangerous can be obtained based on the user data's historical information. If the number of times the attribute information of the user data has been deemed dangerous reaches a specified number (e.g., 3 times), the user data is added to the blacklist. If the specified number of times the attribute information of the user data has been deemed dangerous has not yet reached the specified number, an alarm message is issued.
[0087] Step S309: When the decoded data is the second data, determine that the dangerous attribute of the user data is not dangerous.
[0088] In some implementations, after obtaining the decoded data, it can be compared with first data and second data to determine whether the decoded data is the first data or the second data. Specifically, if the comparison result indicates that the decoded data is the second data, for example, if the decoded data is determined to be "0", it can be determined that the user attribute of the user data corresponding to the decoded data is not dangerous.
[0089] Step S310: When an information request corresponding to the user data is received, respond to the information request.
[0090] In some implementations, when it is determined that the attribute information of the user data is not dangerous, indicating that the operation performed by the user is not dangerous or the behavior of the user is not dangerous, then when an information request corresponding to the user data is received, the information request is responded to in order to respond to the user request normally and meet the user's needs.
[0091] This application provides a method for determining the dangerous attributes of user data in another embodiment. The method involves acquiring user data, which includes time data and feature data with a corresponding relationship. The user data is encoded to obtain encoded data, which includes temporal-space hidden states and feature-space hidden states. Based on a bidirectional attention mechanism, the temporal-space hidden states and feature-space hidden states are calculated to obtain a bidirectional attention matrix. Based on the bidirectional attention matrix and the encoded data, data to be decoded is generated. The data to be decoded is then decoded to obtain decoded data of the user data. When the decoded data is the first type of data, the dangerous attribute of the user data is determined to be dangerous. When an information request corresponding to the user data is received, the information request is rejected, an alarm is issued, and the user data is added to a blacklist. When the decoded data is the second type of data, the dangerous attribute of the user data is determined to be non-dangerous. When the decoded data is the second type of data, the information request is responded to. Compared to... Figure 1 The method for determining the dangerous attributes of user data shown in this embodiment further includes rejecting the information request corresponding to the user data when the dangerous attribute of the user data is determined to be dangerous, and responding to the information request corresponding to the user data when the dangerous attribute of the user data is not dangerous, so as to improve the accuracy of the determination of the dangerous attributes of user data.
[0092] Please see Figure 8 , Figure 8 A block diagram of a user data hazard attribute determination device 200 provided in an embodiment of this application is shown. The following will focus on... Figure 8 The block diagram shown illustrates that the user data hazard attribute determination device 200 includes: a user data acquisition module 210, an encoded data acquisition module 220, a bidirectional attention matrix acquisition module 230, a data to be decoded generation module 240, and a hazard attribute determination module 250, wherein:
[0093] User data acquisition module 210 is used to acquire user data, which includes time data and feature data that have a corresponding relationship.
[0094] The encoded data acquisition module 220 is used to encode the user data to obtain encoded data of the user data, the encoded data including temporal spatial hidden states and feature space hidden states.
[0095] The bidirectional attention matrix acquisition module 230 is used to calculate the temporal-space hidden state and the feature-space hidden state based on the bidirectional attention mechanism to obtain the bidirectional attention matrix.
[0096] Further, the bidirectional attention matrix acquisition module 230 includes: a first fully connected layer acquisition submodule, a second fully connected layer acquisition submodule, and a bidirectional attention matrix acquisition submodule, wherein:
[0097] The first fully connected layer acquisition submodule is used to calculate the temporal and spatial hidden states based on a bidirectional attention mechanism to obtain the first fully connected layer.
[0098] Further, the first fully connected layer acquisition submodule includes: a first weight coefficient matrix acquisition unit and a first fully connected layer acquisition unit, wherein:
[0099] The first weight coefficient matrix acquisition unit is used to acquire the first weight coefficient matrix.
[0100] The first fully connected layer obtaining unit is used to calculate the first weight coefficient matrix and the time-space hidden state to obtain the first fully connected layer.
[0101] Further, the first fully connected layer obtaining unit includes: a first fully connected layer obtaining subunit, wherein:
[0102] The first fully connected layer obtains sub-units, which are used for... The first fully connected layer α is obtained by calculating the first weight coefficient matrix and the temporal hidden state. t Among them, W α This is the first weight coefficient matrix. This represents a hidden state in both time and space.
[0103] The second fully connected layer acquisition submodule is used to calculate the hidden state of the feature space based on the bidirectional attention mechanism to obtain the second fully connected layer.
[0104] Further, the second fully connected layer acquisition submodule includes: a second weight coefficient matrix acquisition unit and a second fully connected layer acquisition unit, wherein:
[0105] The second weight coefficient matrix acquisition unit is used to acquire the second weight coefficient matrix.
[0106] The second fully connected layer obtaining unit is used to calculate the second weight coefficient matrix and the hidden state of the feature space to obtain the second fully connected layer.
[0107] Further, the second fully connected layer obtaining unit includes: a second fully connected layer obtaining subunit, wherein:
[0108] The second fully connected layer obtains sub-units for use based on β. m =W β h m The second weight coefficient matrix and the hidden states in the feature space are calculated to obtain the second fully connected layer β. m Among them, W β h is the second weighting coefficient matrix. m These are the hidden states in the feature space.
[0109] The bidirectional attention matrix acquisition submodule is used to calculate the bidirectional attention matrix by processing the first fully connected layer and the second fully connected layer.
[0110] Furthermore, the bidirectional attention matrix acquisition submodule includes: a weight coefficient vector acquisition unit and a bidirectional attention matrix acquisition unit, wherein:
[0111] The weight coefficient vector acquisition unit is used to obtain the weight coefficient vector.
[0112] The bidirectional attention matrix acquisition unit is used to calculate the weight coefficient vector, the first fully connected layer, and the second fully connected layer to obtain the bidirectional attention matrix.
[0113] Furthermore, the bidirectional attention matrix acquisition unit includes: a bidirectional attention matrix acquisition subunit, wherein:
[0114] Bidirectional attention matrix obtains sub-units for use based on r t m =W r tanh(α t +β m The bidirectional attention matrix r is obtained by calculating the weight coefficient vector, the first fully connected layer, and the second fully connected layer. t m Among them, W r Let α be the weight coefficient vector. t For the first fully connected layer, β m This is the second fully connected layer.
[0115] The data to be decoded generation module 240 is used to generate data to be decoded based on the bidirectional attention matrix and the encoded data.
[0116] Further, the data to be decoded generation module 240 includes: a probability matrix acquisition submodule and a data to be decoded generation submodule, wherein:
[0117] The probability matrix acquisition submodule is used to process the bidirectional attention matrix based on the softmax function to obtain the probability matrix.
[0118] Furthermore, the probability matrix acquisition submodule includes: a probability matrix acquisition unit, wherein:
[0119] The probability matrix acquisition unit is used for obtaining probability matrices based on The probability matrix is obtained by calculating the bidirectional attention matrix. in, This is a bidirectional attention matrix.
[0120] The data to be decoded generation submodule is used to generate the data to be decoded based on the probability matrix and the encoded data.
[0121] Further, the data to be decoded generation submodule includes: a data to be decoded generation unit, wherein:
[0122] Data generation unit to be decoded, used for... The probability matrix and the encoded data are used to calculate the data to be decoded. in, For probability data, For encoded data.
[0123] The danger attribute determination module 250 is used to decode the data to be decoded, obtain the decoded data of the user data, and determine the danger attributes of the user data based on the decoded data.
[0124] Further, the hazard attribute determination module 250 includes: a decoded data acquisition submodule, a first hazard attribute determination submodule, and a second hazard attribute determination submodule, wherein:
[0125] The data decoding acquisition submodule is used to decode the data to be decoded to obtain the decoded data of the user data.
[0126] The first danger attribute determination submodule is used to determine that the danger attribute of the user data is dangerous when the decoded data is first data.
[0127] The second danger attribute determination submodule is used to determine that the danger attribute of the user data is not dangerous when the decoded data is the second data.
[0128] Furthermore, the hazard attribute determination module 250 also includes a request response submodule, wherein:
[0129] The request-response submodule is used to respond to the information request when the user data is received.
[0130] Furthermore, the danger attribute determination module 250 also includes a request rejection submodule, wherein:
[0131] The request rejection submodule is used to reject the information request when it receives the information request corresponding to the user data.
[0132] Furthermore, the hazard attribute determination module 250 also includes: a prompt message issuing submodule, wherein:
[0133] The alert message sending submodule is used to send alarm message and add the user data to the blacklist.
[0134] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0135] In the several embodiments provided in this application, the coupling between modules can be electrical, mechanical, or other forms of coupling.
[0136] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0137] Please see Figure 9 This document illustrates a structural block diagram of an electronic device 100 provided in an embodiment of this application. The electronic device 100 can be a smartphone, tablet computer, e-reader, or other electronic device capable of running applications. The electronic device 100 in this application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications can be stored in the memory 120 and configured to be executed by one or more processors 110, and the one or more applications are configured to perform the methods described in the foregoing method embodiments.
[0138] The processor 110 may include one or more processing cores. The processor 110 connects to various parts within the electronic device 100 using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and by calling data stored in the memory 120. Optionally, the processor 110 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 110 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content to be displayed; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 110 and may be implemented separately using a communication chip.
[0139] The memory 120 may include random access memory (RAM) or read-only memory (ROM). The memory 120 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the various method embodiments described below. The data storage area may also store data created by the electronic device 100 during use (such as phonebook data, audio and video data, chat log data, etc.).
[0140] Please see Figure 10 This diagram illustrates a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. The computer-readable medium 300 stores program code that can be called by a processor to execute the methods described in the above method embodiments.
[0141] The computer-readable storage medium 300 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 300 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 300 has storage space for program code 310 that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code 310 may be compressed, for example, in a suitable form.
[0142] In summary, the user data hazard attribute determination method, apparatus, and electronic device provided in this application acquire user data, which includes time data and feature data with corresponding relationships. The user data is encoded to obtain encoded data, which includes temporal-space latent states and feature-space latent states. Based on a bidirectional attention mechanism, the temporal-space latent states and feature-space latent states are calculated to obtain a bidirectional attention matrix. Based on the bidirectional attention matrix and the encoded data, data to be decoded is generated. The data to be decoded is decoded to obtain decoded data of the user data. Hazard attributes of the user data are determined based on the decoded data. This approach, by embedding a bidirectional attention mechanism into the encoding-decoding structure, mines the hazard attributes of user data, integrates the temporal-space latent states and feature-space latent states to represent attention, and improves the accuracy of hazard attribute determination for user data.
[0143] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method of determining a dangerous property of user data, characterized by, The method comprises: obtaining user data, the user data comprising time data and feature data having a corresponding relationship, the feature data comprising attribute data and behavior data; encoding the user data to obtain encoded data of the user data, the encoded data comprising time-space hidden states and feature-space hidden states, wherein the time-space hidden states are hidden states of the mth channel at all time points, and the feature-space hidden states are hidden states of all channels at the tth moment; based on a bidirectional attention mechanism, calculating the time-space hidden states and the feature-space hidden states to obtain a bidirectional attention matrix, wherein the bidirectional attention matrix integrates the distribution information of the time space and the feature space; generating to-be-decoded data based on the bidirectional attention matrix and the encoded data; decoding the to-be-decoded data to obtain decoded data of the user data, and determining a dangerous attribute of the user data based on the decoded data; wherein, based on the bidirectional attention mechanism, the time-space hidden states and the feature-space hidden states are calculated to obtain a bidirectional attention matrix, comprising: based on the bidirectional attention mechanism, the time-space hidden states are calculated to obtain a first full connection layer; based on the bidirectional attention mechanism, the feature-space hidden states are calculated to obtain a second full connection layer; calculating the first full connection layer and the second full connection layer to obtain the bidirectional attention matrix.
2. The method of claim 1, wherein, Based on the bidirectional attention mechanism, the time-space hidden states are calculated to obtain a first full connection layer, comprising: obtaining a first weight coefficient matrix; calculating the first weight coefficient matrix and the time-space hidden states to obtain a first full connection layer.
3. The method of claim 2, wherein, The calculation of the first weight coefficient matrix and the time-space hidden states to obtain a first full connection layer comprises: based on calculating the first weight coefficient matrix and the time-space hidden state to obtain a first full connection layer wherein, is a first weight coefficient matrix, is a time-space hidden state.
4. The method of claim 3, wherein, Based on the bidirectional attention mechanism, the feature-space hidden states are calculated to obtain a second full connection layer, comprising: obtaining a second weight coefficient matrix; calculating the second weight coefficient matrix and the feature-space hidden states to obtain a second full connection layer.
5. The method of claim 4, wherein, The calculation of the second weight coefficient matrix and the feature-space hidden states to obtain a second full connection layer comprises: based on calculating the second weight coefficient matrix and the feature space hidden state to obtain a second full connection layer wherein, is a second weight coefficient matrix, is a feature space hidden state.
6. The method of claim 5, wherein, The calculation of the first full connection layer and the second full connection layer to obtain the bidirectional attention matrix comprises: obtaining a weight coefficient vector; calculating the weight coefficient vector, the first full connection layer, and the second full connection layer to obtain the bidirectional attention matrix.
7. The method of claim 6, wherein, The calculation of the weight coefficient vector, the first full connection layer, and the second full connection layer to obtain the bidirectional attention matrix comprises: based on calculating the weight coefficient vector, the first full connection layer and the second full connection layer to obtain the bidirectional attention matrix wherein, is a weight coefficient vector, is a first full connection layer, is a second full connection layer.
8. The method of claim 7, wherein, The first weight coefficient matrix is The second weight coefficient matrix is The weight coefficient vector is 9. The method of claim 7, wherein, Based on the bidirectional attention matrix and the encoded data, the to-be-decoded data is generated, comprising: processing the bidirectional attention matrix based on a softmax function to obtain a probability matrix; generating the to-be-decoded data based on the probability matrix and the encoded data.
10. The method of claim 9, wherein, The processing of the bidirectional attention matrix based on a softmax function to obtain a probability matrix comprises: based on performing calculation on the bidirectional attention matrix to obtain the probability matrix wherein, is a bidirectional attention matrix.
11. The method of claim 10, wherein, The generating the to-be-decoded data based on the probability matrix and the encoded data comprises: based on computing the probability matrix and the encoded data to obtain the data to be decoded wherein, is the probability data, is the encoded data.
12. The method according to any one of claims 1 to 11, characterized in that, The encoded data is where T represents a sequence length, and M represents a length of a hidden state, identifies a hidden state of the encoded data with a sequence length of T and a length of M.
13. The method according to any one of claims 1 to 11, characterized in that, The decoding the to-be-decoded data to obtain decoded data of the user data and determining a dangerous attribute of the user data based on the decoded data comprises: decoding the to-be-decoded data to obtain decoded data of the user data; when the decoded data is the first data, determining that the dangerous attribute of the user data is dangerous; when the decoded data is the second data, determining that the dangerous attribute of the user data is not dangerous.
14. The method of claim 13, wherein, The method further comprises: when receiving an information request corresponding to the user data, responding to the information request.
15. The method of claim 13, wherein, The method further comprises: when receiving an information request corresponding to the user data, rejecting the information request.
16. The method of claim 13, wherein, The method further comprises: sending an alarm prompt and adding the user data to a blacklist.
17. An apparatus for determining a dangerous property of user data, characterized by The apparatus comprises: a user data acquisition module configured to acquire user data, the user data comprising time data and feature data that have a corresponding relationship, the feature data comprising attribute data and behavior data; an encoded data obtaining module configured to encode the user data to obtain encoded data of the user data, the encoded data comprising time-space hidden states and feature-space hidden states, wherein the time-space hidden states are hidden states of an mth channel at all time points, and the feature-space hidden states are hidden states of all channels at a tth time point; a bidirectional attention matrix obtaining module configured to calculate the time-space hidden states based on a bidirectional attention mechanism to obtain a first full connection layer, calculate the feature-space hidden states based on the bidirectional attention mechanism to obtain a second full connection layer, and calculate the first full connection layer and the second full connection layer to obtain the bidirectional attention matrix, wherein the bidirectional attention matrix integrates distribution information of time space and feature space at the same time; a to-be-decoded data generating module configured to generate to-be-decoded data based on the bidirectional attention matrix and the encoded data; a dangerous attribute determining module configured to decode the to-be-decoded data to obtain decoded data of the user data and determine a dangerous attribute of the user data based on the decoded data.
18. An electronic device, comprising: The computer readable storage medium stores program codes, and the program codes can be invoked by a processor to execute the method according to any one of claims 1-16.
19. A computer readable storage medium, characterized in that, The computer readable storage medium stores program codes, and the program codes can be invoked by a processor to execute the method according to any one of claims 1-16.
Citation Information
Patent Citations
Credit risk prediction method and device based on LSTM (Long Short Term Memory) model
CN108734338A
Machine reading understanding method based on a multi-head attention mechanism and dynamic iteration
CN109492227A