Risk monitoring method during operation of mobile application, electronic equipment and storage medium
By using target embedding models and multimodal fusion network technology on mobile devices, identifying the behavioral characteristics of mobile applications, the problem of poor sensitivity to new threats in the existing technology is solved, and the risk monitoring effect during mobile applications is improved.
Patent Information
- Application Number
- CN202310518455.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-09
- Publication Date
- 2024-11-12
AI Technical Summary
Existing deep learning-based malware behavior detection technology is poorly sensitive when monitoring new threats, resulting in unsatisfactory risk monitoring results when mobile applications run.
By determining the behavioral characteristics of the application on the target device, using the target embedding model trained by historical behavioral features for risk monitoring, using the triple Triplet network and multimodal fusion network model to map the behavioral features to the embedded feature space, distinguishing Normal and risky behavior.
It improves the monitoring effect of terminal device behavior abnormalities when the mobile application runs, can more accurately identify risks and normal behaviors, and improves sensitivity to new threats.
Smart Images

Figure CN118940261A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of information processing technology, and specifically relates to a method, electronic device and storage medium for monitoring risks during the runtime of a mobile application. Background Art
[0002] With the continuous development of mobile devices and mobile applications, mobile security has become an important research topic. Among them, mobile application security behavior analysis is to identify potential security threats to mobile devices when mobile applications are running by monitoring and analyzing the memory, data, network access and other activities of mobile applications.
[0003] Related deep learning-based malware behavior detection technologies, such as using a convolutional neural network (CNN) to extract features from the application programming interface (API) call graph of a mobile application, and then using a lightweight classifier to calculate the similarity between the API call graph used for malicious activities and the API call graph of the application to be detected, thereby obtaining the possibility that the application to be detected has a security threat; this method is limited to only monitoring known application threats and has poor sensitivity to new threats, resulting in unsatisfactory monitoring results. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a method, electronic device and storage medium for monitoring risks during the runtime of a mobile application, which can improve the monitoring effect of abnormal terminal device behavior during the runtime of a mobile application.
[0005] In order to solve the above technical problems, this application is implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides a method for risk monitoring during runtime of a mobile application, the method comprising: determining multiple target behavior features corresponding to a first application within a first time period, the first time period including at least one time period after the first application is started on a target device; inputting the multiple target behavior features into a target embedding model to obtain a target embedding feature corresponding to the first application, the target embedding model being trained by multiple historical behavior features corresponding to the first application before the first time period; determining a risk monitoring result corresponding to the first application within the first time period based on the target embedding feature, the risk monitoring result including at least one of risk or normal.
[0007] In a second aspect, an embodiment of the present application provides a device for monitoring the runtime risks of a mobile application, the device comprising: a first determination module, used to determine multiple target behavior features corresponding to a first application within a first time period, the first time period including at least one time period after the first application is started on a target device; a feature conversion module, used to input the multiple target behavior features into a target embedding model to obtain a target embedding feature corresponding to the first application, the target embedding model is trained by multiple historical behavior features corresponding to the first application before the first time period; a second determination module, used to determine the risk monitoring result corresponding to the first application within the first time period based on the target embedding feature, the risk monitoring result including at least one of risk or normal.
[0008] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0009] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0010] In an embodiment of the present application, by determining multiple target behavior features corresponding to a first application within a first time period, the first time period includes at least one time period after the first application is started on a target device; inputting the multiple target behavior features into a target embedding model to obtain a target embedding feature corresponding to the first application, the target embedding model is trained by multiple historical behavior features corresponding to the first application before the first time period; based on the target embedding feature, determining a risk monitoring result corresponding to the first application within the first time period, the risk monitoring result includes at least one of risk or normal, which can improve the monitoring effect of abnormal terminal device behavior when the mobile application is running. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0012] Figure 1 It is a flowchart of a method for monitoring risks during the runtime of a mobile application provided in an embodiment of the present application.
[0013] Figure 2 This is an example diagram of a method for modeling runtime behavior characteristics of a mobile application provided in an embodiment of the present application.
[0014] Figure 3 It is a flowchart of another method for monitoring risks during runtime of mobile applications provided in an embodiment of the present application.
[0015] Figure 4 It is a structural diagram of a target embedding model provided in an embodiment of the present application.
[0016] Figure 5 It is a structural diagram of a triplet network provided in an embodiment of the present application.
[0017] Figure 6 It is a structural diagram of a multimodal fusion network model provided in an embodiment of the present application.
[0018] Figure 7 It is a structural diagram of a device for monitoring risks during the runtime of a mobile application provided in an embodiment of the present application.
[0019] Figure 8 It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0020] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0021] Figure 1 A flow chart of a method for monitoring the risk of a mobile application during runtime provided by an embodiment of the present application is shown. The method can be executed by an electronic device, such as a mobile electronic device. In other words, the method can be executed by software or hardware installed in the electronic device. Figure 1 As shown, the method may include the following steps.
[0022] S101: Determine a plurality of target behavior features corresponding to a first application within a first time period.
[0023] The first time period includes at least one time period after the first application is started on the target device.
[0024] This step obtains multiple target behavior features corresponding to the first application within a certain period of time after the first application is started. Figure 2 As shown, the application-related environment can be described in a fine-grained manner at the minute level from the time dimension and the behavior state dimension. Figure 2 Each small cell in the figure represents multiple behavior state features of the first application collected at a certain point in time one minute after the first application is started, such as debugging behavior, customized ROM, sensitive API calls, etc., which constitute the behavior state vector corresponding to the first application at that point in time.
[0025] S102: Input the multiple target behavior features into a target embedding model to obtain target embedding features corresponding to the first application.
[0026] The target embedding model is trained by multiple historical behavior features corresponding to the first application before the first time period. By learning the massive historical behavior data corresponding to the first application before the first time period, a target embedding model is obtained, and the target embedding model can map the multiple target behavior features to an embedding feature space, in which normal behavior and risky behavior can be better separated.
[0027] S103: Determine, according to the target embedding feature, a risk monitoring result corresponding to the first application in the first time period.
[0028] The risk monitoring result includes at least one of risk or normal.
[0029] An embodiment of the present application provides a method for risk monitoring at runtime of a mobile application, by determining multiple target behavior features corresponding to a first application within a first time period, the first time period including at least one time period after the first application is started on a target device; inputting the multiple target behavior features into a target embedding model to obtain a target embedding feature corresponding to the first application, the target embedding model being trained by multiple historical behavior features corresponding to the first application before the first time period; determining a risk monitoring result corresponding to the first application within the first time period based on the target embedding feature, the risk monitoring result including at least one of risk or normal, which can improve the monitoring effect of abnormal terminal device behavior when the mobile application is running.
[0030] In one implementation, before the aforementioned step S101, the method further includes: S100: establishing a target embedding model according to a plurality of historical behavior features corresponding to the first application before the first time period.
[0031] Specifically, the following steps may be included:
[0032] S001: Select a first sample, a second sample, and a third sample from the plurality of historical behavior features to form a triplet.
[0033] The label corresponding to the second sample is the same as the label corresponding to the first sample, the label corresponding to the third sample is different from the label corresponding to the first sample, and the label includes at least one of risk or normal.
[0034] S002: Input the triplet into the target embedding model to be trained to obtain a first embedding feature corresponding to the first sample, a second embedding feature corresponding to the second sample, and a third embedding feature corresponding to the third sample.
[0035] S003: Adjust the parameters of the target embedding model to be trained so that the value of the target loss function converges to a preset threshold, thereby obtaining the target embedding model.
[0036] The target loss function includes making the distance between the vector corresponding to the first embedded feature and the vector corresponding to the second embedded feature smaller than the distance between the vector corresponding to the first embedded feature and the vector corresponding to the third embedded feature.
[0037] For example, a triplet sample is composed of (X,X + ,X-), where X represents the anchor sample (the first sample) selected from the training sample and the positive sample X corresponding to the sample category + (Second sample), negative sample X corresponding to sample category X - (Third sample) This step trains a triplet network to embed each triplet component into the D-dimensional Euler space. The Triplet network optimizes a triplet loss function. This loss function minimizes the loss between the anchor sample X and X + In the embedding space, the distance between the anchor sample X and X is maximized. - The distance in the embedding space. For example, the loss function can be expressed as follows:
[0038]
[0039] In one implementation, before the aforementioned step S001, the method further includes: compressing and encoding the historical behavior features corresponding to the second sample and the historical behavior features corresponding to the third sample respectively and then decoding them.
[0040] In the process of using the Triplet network training model to conduct risk assessment on mobile applications and terminal behaviors, the training method based on the Triplet network usually encounters the problem of poor convergence. The convergence problem is mainly caused by the random selection of triplet construction samples in the training set. Under normal circumstances, the malicious attack behavior of mobile application terminal devices accounts for a small proportion of the behavior of all users, that is, the positive samples (abnormal attack behavior) and negative samples (normal application / device behavior) are extremely unbalanced. Therefore, in an embodiment of the present application, two automatic encoders are used to perform independent representation learning on the positive and negative samples respectively. In this representation space, normal behavior and risky behavior are easier to distinguish, such as Figure 4 As shown, the two automatic encoders are g n .f n and g a .f a .
[0041] In one implementation, the target embedding model includes an input layer, a fully connected layer, and an embedding layer. Specifically, Figure 5 As shown in the figure, the Triplet network is implemented based on three forward networks with shared weights. Each basic network is a deep neural network with three intermediate layers, an embedding layer with 512 neurons and two Dropout layers. The Rule function is used as the activation function each time.
[0042] In one implementation, the risk monitoring result corresponding to the first application in the first time period is determined based on the target embedding feature, including: when the first distance is less than the second distance, the risk monitoring result corresponding to the first application in the first time period is normal; when the first distance is not less than the second distance, the risk monitoring result corresponding to the first application in the first time period is risk.
[0043] Among them, the first distance includes the distance between the vector corresponding to the target embedded feature and the vector corresponding to the first embedded feature, the second distance includes the distance between the vector corresponding to the target embedded feature and the vector corresponding to the second embedded feature, the label corresponding to the first embedded feature is normal, and the label corresponding to the second embedded feature is risk.
[0044] In one implementation, determining a plurality of target behavior features corresponding to the first application within the first time period includes: collecting behavior features corresponding to the target device and the first application within the first time period through a software development kit (SDK) probe.
[0045] The Software Development Kit (SDK) probe relies on the operating environment of the front-end project. It adds probe functions to the underlying API of its operating environment to collect information and dynamically monitor the behavior of the terminal device in the mobile application operating environment. The information collected includes:
[0046] (1) Terminal device attributes and characteristics:
[0047] In order to obtain device attribute characteristics, the mobile application implant probe will collect basic information of the terminal device when it is started. i The symbol represents the basic attribute characteristics of the device when the application is started for the i-th time, f i =(p1,p2p3,…,p m ), m is the dimension of device features. For terminal device features, it is necessary to study the basic data types of terminal devices and the value range of each basic dimension.
[0048] (2) Behavior sequence characteristics of terminal devices:
[0049] After the mobile application is started on the terminal device, the SDK probe in the application collects and detects the terminal device behavior every minute. It represents the terminal device behavior sequence that the SDK probe needs to detect, and n is the dimension of the device behavior. represents the behavior sequence characteristics of the application starting the terminal device for the i-th time, where Represents the behavior sequence characteristics of the tth detection after the application is launched.
[0050] (3) Mobile application attribute characteristics:
[0051] The attribute characteristics of mobile applications will be collected using static detection and dynamic analysis technology, mainly collecting sensitive API calls of mobile applications. i Indicates the application attribute characteristics of the i-th launch, mobile i =(v1,v2v3,…,v t ), t is the dimension of application features.
[0052] (4) Behavioral sequence characteristics of mobile applications:
[0053] After the mobile application is launched on the terminal device, the SDK probe collects mobile application behavior at the minute level.
[0054] Using symbols represents the terminal device behavior sequence that the SDK probe needs to detect, k is the dimension of the device behavior feature, then represents the behavior sequence characteristics of the application starting the terminal device for the i-th time, where Represents the behavior sequence characteristics of the tth detection after the application is launched.
[0055] The embodiment of the present application lays a data feature foundation for risk assessment modeling of mobile applications and terminal devices by modeling the behavior sequence of the terminal device and the application after the application is started.
[0056] In one implementation, the multiple target behavior features are input into a target embedding model to obtain a target embedding feature corresponding to the first application, including: fusing the multiple target behavior features in chronological order and then encoding them to obtain a target behavior state vector; and inputting the target behavior state vector into a target embedding model to obtain a target embedding feature corresponding to the first application.
[0057] In one implementation, the multiple target behavior features are fused in chronological order and then encoded to obtain a target behavior state vector, including: inputting the multiple target behavior features into a target fusion network, and outputting the target behavior state vector, the target fusion network including an input layer, a fusion layer, a coding layer and an output layer, and the target fusion network is used to map the fused multiple target behavior features to the same vector space.
[0058] Based on the behavioral sequence features of the terminal device and the mobile application constructed above, the running state vector is obtained for the mobile application in the tth minute after the terminal device i is started. However, such a mobile application running state vector faces two problems. The time window used for each application startup is inconsistent, resulting in inconsistent lengths of the running state vector used by each application; device attribute features, application attribute features, application behavior features and device behavior features belong to different feature representation spaces, and it is difficult to obtain a good model effect by directly inputting them into the model. Therefore, this application encodes the running state sequence after the application is started by using a representation learning method, and fuses the device attribute features, application attribute features, application behavior features and device behavior features through an automatic encoding multimodal feature fusion technology.
[0059] Specifically, the Long Short-Term Memory (LSTM) network can be used to encode the aforementioned behavioral features and convert the application running behavior status Input LSTM network to get the startup terminal and application feature vector Then the aforementioned running state vector Input a multimodal fusion model to get the final representation vector like Figure 6As shown in Figure 2, multimodal fusion can reduce the heterogeneity between modalities while maintaining the integrity of the specific semantics of each modality and achieve better performance in the subsequent metric learning model.
[0060] In one implementation, the multimodal fusion model (target fusion model) may include an encoder and a decoder to complete the conversion task of mapping one modality to another. The encoder maps the source modality to a vector v, and the decoder generates a new target modality sample based on the vector v. The autoencoder is a neural network that uses a back-propagation algorithm to make the output value equal to the input value. After passing through an autoencoder, it first compresses the input into a latent space representation, and then reconstructs the output through this representation.
[0061] The method for risk monitoring at runtime of a mobile application provided in an embodiment of the present application establishes a target embedding model based on multiple historical behavior features corresponding to the first application before a first time period; determines multiple target behavior features corresponding to the first application within the first time period, the first time period including at least one time period after the first application is started on a target device; inputs the multiple target behavior features into the target embedding model to obtain a target embedding feature corresponding to the first application, the target embedding model is trained by multiple historical behavior features corresponding to the first application before the first time period; determines a risk monitoring result corresponding to the first application within the first time period based on the target embedding feature, the risk monitoring result includes at least one of risk or normal, which can improve the monitoring effect of abnormal terminal device behavior when the mobile application is running.
[0062] Figure 7 A schematic diagram of a mobile application runtime risk monitoring device provided by an embodiment of the present application is shown. Figure 7 As shown, the device 700 includes: a first determination module 710, a feature conversion module 720 and a second determination module 730.
[0063] A first determination module 710 is used to determine a plurality of target behavior features corresponding to a first application within a first time period, wherein the first time period includes at least one time period after the first application is started on a target device; a feature conversion module 720 is used to input the plurality of target behavior features into a target embedding model to obtain a target embedding feature corresponding to the first application, wherein the target embedding model is trained by a plurality of historical behavior features corresponding to the first application before the first time period; and a second determination module 730 is used to determine a risk monitoring result corresponding to the first application within the first time period based on the target embedding feature, wherein the risk monitoring result includes at least one of risk or normal.
[0064] In one implementation, the device 700 also includes: an establishment module, used to: select a first sample, a second sample, and a third sample from the multiple historical behavior features to form a triplet, wherein the label corresponding to the second sample is the same as the label corresponding to the first sample, and the label corresponding to the third sample is different from the label corresponding to the first sample, and the label includes at least one of risk or normal; input the triplet into the target embedding model to be trained to obtain a first embedding feature corresponding to the first sample, a second embedding feature corresponding to the second sample, and a third embedding feature corresponding to the third sample; adjust the parameters of the target embedding model to be trained so that the value of the target loss function converges to a preset threshold to obtain the target embedding model.
[0065] The target loss function includes making the distance between the vector corresponding to the first embedded feature and the vector corresponding to the second embedded feature smaller than the distance between the vector corresponding to the first embedded feature and the vector corresponding to the third embedded feature.
[0066] In one implementation, the feature conversion module 720 is used to: fuse and encode the multiple target behavior features in chronological order to obtain a target behavior state vector; input the target behavior state vector into a target embedding model to obtain a target embedding feature corresponding to the first application.
[0067] In one implementation, the second determination module 730 is used to: when the first distance is less than the second distance, the risk monitoring result corresponding to the first application in the first time period is normal; when the first distance is not less than the second distance, the risk monitoring result corresponding to the first application in the first time period is risk; wherein, the first distance includes the distance between the vector corresponding to the target embedded feature and the vector corresponding to the first embedded feature, the second distance includes the distance between the vector corresponding to the target embedded feature and the vector corresponding to the second embedded feature, the label corresponding to the first embedded feature is normal, and the label corresponding to the second embedded feature is risk.
[0068] In one implementation, the establishing module is used to: compress and encode the historical behavior features corresponding to the second sample and the historical behavior features corresponding to the third sample respectively and then decode them.
[0069] In one implementation, the target embedding model includes an input layer, a fully connected layer, and an embedding layer.
[0070] In one implementation, the first determination module 710 is used to collect behavior characteristics corresponding to the target device and the first application within a first time period through a software development kit (SDK) probe.
[0071] In one implementation, the feature conversion module 720 is used to: input the multiple target behavior features into a target fusion network, and output the target behavior state vector, wherein the target fusion network includes an input layer, a fusion layer, a coding layer, and an output layer, and the target fusion network is used to map the fused multiple target behavior features to the same vector space.
[0072] The device for monitoring the runtime risks of mobile applications provided in the embodiments of the present application can execute the method for monitoring the runtime risks of mobile applications described in at least one embodiment of the foregoing method embodiments, and can achieve the same technical effects as the foregoing method embodiments, which will not be repeated here.
[0073] Figure 8 A schematic diagram of the hardware structure of an electronic device that implements the embodiment of the present application is shown. Referring to the figure, at the hardware level, the electronic device includes a processor, and optionally, an internal bus, a network interface, and a memory. Among them, the memory may include a memory, such as a high-speed random access memory (Random-Access Memory, RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage, etc. Of course, the electronic device may also include hardware required for other services.
[0074] The processor, the network interface and the memory may be interconnected through an internal bus, which may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one bidirectional arrow is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0075] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.
[0076] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a device for locating the target user at the logical level. The processor executes the program stored in the memory and is specifically used to execute: each step of the method for mobile application runtime risk monitoring described in at least one embodiment of the above method embodiments.
[0077] The methods disclosed in the embodiments shown in the flowcharts of the present application can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0078] The electronic device can also execute the method for mobile application runtime risk monitoring described in at least one of the foregoing method embodiments, and can achieve the same technical effect as the foregoing method embodiments, which will not be repeated here.
[0079] Of course, in addition to software implementation methods, the electronic device of the present application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0080] An embodiment of the present application also proposes a computer-readable storage medium, which stores one or more programs. When the one or more programs are executed by an electronic device including multiple applications, the electronic device executes each step of the method for mobile application runtime risk monitoring described in at least one embodiment of the above-mentioned method embodiments.
[0081] The computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0082] Furthermore, an embodiment of the present application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the steps of at least one embodiment of the above-mentioned method embodiments are implemented.
[0083] In short, the above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0084] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0085] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0086] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0087] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
Claims
1. A method for monitoring risks during the runtime of a mobile application, characterized in that: The method comprises: Determining a plurality of target behavior features corresponding to a first application within a first time period, wherein the first time period includes at least one time period after the first application is started on a target device; Inputting the multiple target behavior features into a target embedding model to obtain target embedding features corresponding to the first application, wherein the target embedding model is trained by multiple historical behavior features corresponding to the first application before the first time period; A risk monitoring result corresponding to the first application in the first time period is determined according to the target embedding feature, and the risk monitoring result includes at least one of risk or normal.
2. The method according to claim 1, characterized in that Before inputting the plurality of target behavior features into a target embedding model to obtain a target embedding feature corresponding to the first application, the method further includes: Selecting a first sample, a second sample, and a third sample from the plurality of historical behavior features to form a triplet, wherein a label corresponding to the second sample is the same as a label corresponding to the first sample, a label corresponding to the third sample is different from a label corresponding to the first sample, and the label includes at least one of risk or normal; Inputting the triplet into the target embedding model to be trained to obtain a first embedding feature corresponding to the first sample, a second embedding feature corresponding to the second sample, and a third embedding feature corresponding to the third sample; Adjusting the parameters of the target embedding model to be trained so that the value of the target loss function converges to a preset threshold, thereby obtaining the target embedding model; The target loss function includes making the distance between the vector corresponding to the first embedded feature and the vector corresponding to the second embedded feature smaller than the distance between the vector corresponding to the first embedded feature and the vector corresponding to the third embedded feature.
3. The method according to claim 1, characterized in that Inputting the plurality of target behavior features into a target embedding model to obtain target embedding features corresponding to the first application includes: The multiple target behavior features are fused and then encoded in time order to obtain a target behavior state vector; The target behavior state vector is input into a target embedding model to obtain a target embedding feature corresponding to the first application.
4. The method according to claim 2, characterized in that: Determining, according to the target embedding feature, a risk monitoring result corresponding to the first application in the first time period, including: When the first distance is less than the second distance, the risk monitoring result corresponding to the first application in the first time period is normal; When the first distance is not less than the second distance, the risk monitoring result corresponding to the first application in the first time period is risk; Among them, the first distance includes the distance between the vector corresponding to the target embedded feature and the vector corresponding to the first embedded feature, the second distance includes the distance between the vector corresponding to the target embedded feature and the vector corresponding to the second embedded feature, the label corresponding to the first embedded feature is normal, and the label corresponding to the second embedded feature is risk.
5. The method according to claim 2, characterized in that: Before inputting the triplet into the target embedding model to be trained to obtain a first embedding feature corresponding to the first sample, a second embedding feature corresponding to the second sample, and a third embedding feature corresponding to the third sample, the method further includes: The historical behavior features corresponding to the second sample and the historical behavior features corresponding to the third sample are respectively compressed and encoded and then decoded.
6. The method according to claim 1, characterized in that The target embedding model includes an input layer, a fully connected layer and an embedding layer.
7. The method according to claim 1, characterized in that The determining of a plurality of target behavior features corresponding to the first application within the first time period includes: The behavior characteristics corresponding to the target device and the behavior characteristics corresponding to the first application in the first time period are collected through a software development kit SDK probe.
8. The method according to claim 3, characterized in that The step of fusing the multiple target behavior features in chronological order and then encoding them to obtain a target behavior state vector includes: The multiple target behavior features are input into a target fusion network, and the target behavior state vector is output. The target fusion network includes an input layer, a fusion layer, a coding layer and an output layer. The target fusion network is used to map the fused multiple target behavior features to the same vector space.
9. An electronic device, characterized in that: The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method according to any one of claims 1 to 8.
10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
