A software privacy compliance detection method, device, storage medium and product
By constructing heterogeneous diagrams of software samples and generating path examples using reinforcement learning and graph characterization models, the problems of low detection accuracy and high threshold in the prior art are solved, and more efficient and accurate software privacy compliance detection is achieved.
Patent Information
- Application Number
- CN202410636858.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-22
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-05-22
AI Technical Summary
The existing software privacy compliance detection methods have problems such as low detection accuracy, high threshold, slow detection speed and lack of effective privacy compliance data sets.
By extracting the structural characteristics of the sample software, building heterogeneous graphs, and using reinforcement learning and graph characterization models to generate metapathic paths and path instances, training the software's privacy compliance detection model, and realizing automated detection.
It improves the accuracy and efficiency of software privacy compliance inspection, lowers the threshold for inspectors, and provides faster and more accurate inspection results.
Smart Images

Figure CN118606174B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software privacy compliance analysis, and in particular to a software privacy compliance detection method, device, storage medium and product. Background Art
[0002] As the number of software and users continues to increase, the problem of software user privacy information leakage frequently occurs. Therefore, although software in various industries brings convenience to users, it also brings great security risks to users' digital property, privacy and personal information. Therefore, how to build an effective automated compliance detection method has become a current research difficulty. Among them, building an effective privacy compliance data set, improving the detection accuracy of privacy compliance detection models, and accurately discovering privacy-infringing compliance software in massive software and determining whether it has violations are the most important challenges in the current privacy compliance software detection method.
[0003] In order to effectively mine the hidden features in these non-compliant software, existing research work mainly attempts to use code instrumentation methods to build API (Application Program Interface) test scripts to detect whether software behaviors such as APIs and permissions in the software have non-compliant behaviors. However, these manually constructed hook code scripts have a narrow coverage of software behaviors and require testers to have high professional knowledge to cope with different detection tasks. In addition, the detection of each software requires manual customization of relevant detection strategies and code scripts for specific behavior detection. Therefore, the upper limit of the detection accuracy of these traditional privacy compliance software is low, and the detection speed of these tools is slow. To this end, researchers have tried to automatically detect non-compliant software through machine learning methods, but the existing software privacy compliance detection methods based on machine learning have the following problems.
[0004] First, there is a lack of public and effective privacy compliance data sets. Artificial intelligence methods cannot be trained in a supervised manner, which directly hinders the progress of intelligent detection of software privacy compliance, resulting in many existing advanced algorithms being unable to conduct in-depth research and assist researchers in developing effective detection tools.
[0005] Second, there is currently a lack of efficient machine learning compliance detection methods. Since traditional machine learning algorithms can only simply count the static discrete features of samples, such as the number of APIs and permissions in the software and statistical data information, and cannot mine the inherent structural features of software behavior, these privacy compliance detection methods have weak features for software representation and poor detection results.
[0006] Third, current research lacks an autonomous and fast compliance detection method. Existing detection tools are based on methods that dynamically simulate user click functions. These dynamic behaviors involve code execution and API calls in the software, so it takes researchers a long time to detect non-compliant behaviors of the software through code scripts. In addition, writing corresponding code scripts requires operators to have high professional skills. These operations have greatly increased the threshold for detection personnel and delayed the progress of detection.
[0007] Therefore, there is an urgent need for a software privacy compliance testing method with better testing results and lower requirements for testing personnel. Summary of the invention
[0008] The purpose of the present invention is to provide a software privacy compliance detection method, device, storage medium and product, which can provide better detection results and have low threshold requirements for detection personnel.
[0009] To achieve the above object, the present invention provides the following solutions:
[0010] A software privacy compliance detection method, comprising:
[0011] Extract sample features corresponding to each sample software; the sample features include: a call sequence between APP and target API, a call sequence between target API and target API, a call sequence between target API and Class, a call sequence between target API and target permission, and a call sequence between APP and target permission; the target API is an API related to user privacy information; the target permission is a permission related to user privacy; the sample software is software that violates the privacy compliance policy;
[0012] A heterogeneous graph corresponding to each sample software is constructed based on the sample features corresponding to each sample software; the nodes of the heterogeneous graph include APP, API, Class and permission; the edge of the heterogeneous graph is a call sequence between two nodes connected by the edge;
[0013] In the current iteration round, reinforcement learning is used to process each of the heterogeneous graphs according to the reinforcement learning reward function value in the previous iteration round to obtain the meta-path corresponding to each sample software in the current iteration round;
[0014] Generate the path instance corresponding to each sample software in the current iteration round according to the meta-path corresponding to each sample software in the current iteration round, and use the graph representation model to process the path instance corresponding to each sample software in the current iteration round to obtain the vector representation of each node in the path instance corresponding to each sample software in the current iteration round;
[0015] The software privacy compliance detection model in the previous iteration round is trained using the training set to obtain the software privacy compliance detection model in the current iteration round; the training set includes the vector representation of each node in the path instance corresponding to each sample software in the current iteration round and the detection result of each sample software, and the detection result includes violation of the privacy compliance policy and non-violation of the privacy compliance policy; the software privacy compliance detection model in the initial iteration round is a graph embedding model;
[0016] Calculate the value of the reinforcement learning reward function under the current iteration round according to the vector representation of each node in the path instance corresponding to each sample software under the current iteration round, update the iteration round, and enter the next iteration until the set iteration round is reached;
[0017] The sample features corresponding to the software to be tested are input into the software privacy compliance detection model in the last iteration round to obtain the detection result of the software to be tested.
[0018] Optionally, in the current iteration round, reinforcement learning is used to process each of the heterogeneous graphs according to the reinforcement learning reward function value in the previous iteration round to obtain the meta-path corresponding to each sample software in the current iteration round, specifically:
[0019] In the current iteration round, the edges in the heterogeneous graph are used as actions in the reinforcement learning, and the heterogeneous graph is used as environmental data in the reinforcement learning. Reinforcement learning is used to extract a sample path for each sample from the heterogeneous graph according to the reinforcement learning reward function value in the previous iteration round.
[0020] Optionally, the action-value function in reinforcement learning is:
[0021] Among them, Q π () represents the action value function, V() represents the state value function, A() represents the action advantage function, A represents the action set in reinforcement learning, s represents the state in reinforcement learning, a represents the action in reinforcement learning, θ represents the convolutional layer parameters in the DuelingDQN algorithm, α represents the first fully connected layer parameters in the DuelingDQN algorithm, β represents the second fully connected layer parameters in the DuelingDQN algorithm, a' represents any action in A, represents the average value of the action advantage function, sqrt() represents the square root, and |A| represents the size of the action space.
[0022] Optionally, the loss function in reinforcement learning is Loss(θ)=E π [(Q π (s,a;θ)-Q π (s,a)) 2], where Loss() represents the loss function in reinforcement learning, E π [] represents the expected function, Q π () represents the action-value function, s represents the state in reinforcement learning, a represents the action in reinforcement learning, and θ represents the convolutional layer parameters in the DuelingDQN algorithm.
[0023] Optionally, the loss function in the process of using the training set to train the software privacy compliance detection model in the previous iteration round to obtain the software privacy compliance detection model in the current iteration round is:
[0024] in, represents the loss function for training the graph embedding model, x represents the detection result of the sample software, y i represents the vector representation of the i-th node output by the graph representation model, and Emb'[i] represents the predicted vector representation of the i-th node predicted by the graph embedding model.
[0025] A computer device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the software privacy compliance detection method described above.
[0026] A computer-readable storage medium stores a computer program, which implements the software privacy compliance detection method described above when executed by a processor.
[0027] A computer program product includes a computer program, which implements the above-mentioned software privacy compliance detection method when executed by a processor.
[0028] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0029] The present invention extracts sample features corresponding to each sample software; constructs a heterogeneous graph corresponding to each sample software based on the sample features corresponding to each sample software; in the current iteration round, uses reinforcement learning to process each heterogeneous graph according to the reinforcement learning reward function value in the previous iteration round to obtain the meta-path corresponding to each sample software in the current iteration round; generates a path instance corresponding to each sample software in the current iteration round according to the meta-path corresponding to each sample software in the current iteration round, and uses a graph representation model to process the path instance corresponding to each sample software in the current iteration round to obtain the vector representation of each node in the path instance corresponding to each sample software in the current iteration round; uses a training set to train a software privacy compliance detection model in the previous iteration round to obtain a software privacy compliance detection model in the current iteration round; calculates the reinforcement learning reward function value in the current iteration round according to the vector representation of each node in the path instance corresponding to each sample software in the current iteration round, updates the iteration round, and enters the next iteration until the set iteration round is reached; inputs the sample features corresponding to the software to be detected into the software privacy compliance detection model in the last iteration round to obtain the detection result of the software to be detected, which can provide a better detection effect and has a low threshold requirement for detection personnel. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0031] Figure 1 A schematic diagram of a software privacy compliance detection method provided by an embodiment of the present invention;
[0032] Figure 2 A flowchart of a software privacy compliance detection method provided by an embodiment of the present invention;
[0033] Figure 3 A framework diagram of a software privacy compliance detection method provided by an embodiment of the present invention;
[0034] Figure 4 A flowchart of a software privacy compliance detection method provided by an embodiment of the present invention;
[0035] Figure 5 This is a diagram of the internal structure of a computer device. DETAILED DESCRIPTION
[0036] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0037] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0038] The software privacy compliance detection method provided by the present invention is as follows: Figure 2 to Figure 3 As shown, it includes: extracting structural features from sample software; these structural features mainly include APIs, classes and call sequences between permissions related to privacy compliance behaviors in sample software; constructing heterogeneous graph data of software privacy compliance based on the above related sequence information; combining reinforcement learning to construct sample paths for each sample software from heterogeneous graph data; training the graph embedding model with the training set to obtain a software privacy compliance detection model; the sample data in the training data set is composed of various sample paths; bringing the structural features of the software to be detected into the software privacy compliance detection model to obtain the type of software data to be detected (violating privacy compliance policies and not violating privacy compliance policies). Specific steps, such as Figure 4 Shown include:
[0039] Step 101: Extract sample features corresponding to each sample software. The sample features include: the call sequence between APP and target API, the call sequence between target API and target API, the call sequence between target API and Class, the call sequence between target API and target permission, and the call sequence between APP and target permission; the target API is an API related to user privacy information; the target permission is a permission related to user privacy; the sample software is software that violates the privacy compliance policy.
[0040] Step 102: construct a heterogeneous graph corresponding to each sample software based on the sample features corresponding to each sample software; the nodes of the heterogeneous graph include APP, API, Class and permission; the edge of the heterogeneous graph is a call sequence between two nodes connected by the edge.
[0041] Step 103: In the current iteration round, reinforcement learning is used to process each of the heterogeneous graphs according to the reinforcement learning reward function value in the previous iteration round to obtain the meta-path corresponding to each sample software in the current iteration round.
[0042] Step 104: Generate a path instance corresponding to each sample software in the current iteration round according to the meta-path corresponding to each sample software in the current iteration round, and use a graph representation model to process the path instance corresponding to each sample software in the current iteration round to obtain a vector representation of each node in the path instance corresponding to each sample software in the current iteration round.
[0043] Step 105: Use the training set to train the software privacy compliance detection model in the previous iteration round to obtain the software privacy compliance detection model in the current iteration round; the training set includes the vector representation of each node in the path instance corresponding to each sample software in the current iteration round and the detection result of each sample software, and the detection result includes violation of the privacy compliance policy and non-violation of the privacy compliance policy; the software privacy compliance detection model in the initial iteration round is a graph embedding model.
[0044] Step 106: Calculate the value of the reinforcement learning reward function in the current iteration round according to the vector representation of each node in the path instance corresponding to each sample software in the current iteration round, update the iteration round, and enter the next iteration until the set iteration round is reached.
[0045] Step 107: Input the sample features corresponding to the software to be detected into the software privacy compliance detection model in the last iteration round to obtain the detection result of the software to be detected.
[0046] In practical applications, the sample features corresponding to each sample software are extracted specifically including:
[0047] Step 1: In order to construct a real and usable privacy compliance data set, the present invention combines the software privacy compliance list reported by the Ministry of Industry and Information Technology, downloads sample software that violates the privacy compliance policy on the application platform, and labels the notification reasons for each sample software. For example, the "illegal collection of personal information" and "illegal use of personal information" in the illegal software are unified as non-compliant use of personal information software. The labeled sample software is used as a training set to assist the privacy compliance detection model in supervised training.
[0048] Step 2: construct effective training data. First, pre-process each sample software by reverse compilation to obtain the structural features of these software, such as the software name (Name), the API in the software code, the Class in the code, and the characteristic information between the permissions (Perm) of the code. In addition, since the software contains a large number of benign APIs, this will increase the difficulty of detecting software compliance. Therefore, the present invention screens the APIs and permissions in the software and only retains the APIs and permission nodes related to the use of user privacy information, such as the API for obtaining the software to extract the user's geographic location information: getLastKnownLocation and the permission for obtaining geographic information: ACCESS_COARSE_LOCATION, etc.
[0049] In practical applications, the heterogeneous graph corresponding to each sample software is constructed based on the sample features corresponding to each sample software. Specifically, the graph nodes in the heterogeneous graph data are mainly Name, API, Class and Perm in the software, and the edges of the heterogeneous graph are composed of the call sequences between these graph nodes. The above edges and nodes are jointly constructed as heterogeneous graph data, and the edges and nodes are also used as data input for the privacy compliance detection model. In addition, the heterogeneous graph data G constructed in this step is used as the environment data of reinforcement learning to interact with the intelligent agent.
[0050] In practical applications, in the current iteration round, reinforcement learning is used to process each of the heterogeneous graphs according to the reinforcement learning reward function value in the previous iteration round to obtain the meta-path corresponding to each sample software in the current iteration round, specifically:
[0051] In the current iteration round, the edges in the heterogeneous graph are used as actions in the reinforcement learning, and the heterogeneous graph is used as environmental data in the reinforcement learning. Reinforcement learning is used to extract a sample path for each sample from the heterogeneous graph according to the reinforcement learning reward function value in the previous iteration round, and the reward function value is calculated according to formula (4).
[0052] In practical applications, after building relevant heterogeneous graph data, in order to effectively characterize nodes and edges, it is necessary to construct the meta-path of the sample and generate the corresponding path representation. For example, the API→Perm meta-path is generated by the reinforcement learning method, and then the sample software uses this path as a template to generate one of the path instances: getLastKnownLocation→ACCESS_COARSE_LOCATION, and uses it to generate path representation and conduct training.
[0053] The node selection of the meta-path can be regarded as a reinforcement learning process and is represented by the following four-tuple (S, A, P, R). S represents the reinforcement learning state State, which is the meta-path set, A represents the reinforcement learning behavior Action, which is the edge in the heterogeneous graph, P represents the policy in reinforcement learning, and R is the reward function Reward of reinforcement learning.
[0054] (1) Policy: The policy function π() maps the state in reinforcement learning to the probability distribution of all the actions selected by the agent, as shown in formula (1):
[0055] π(a t |S t )S×A→[0,1] (1)
[0056] Among them, π(a t |s t ) is the strategy encoding the current state s t Select action a t In addition, the reinforcement learning strategy is DuelingDQN, which improves the network of the original DQN algorithm and divides the output into two parts: the state value function and the action advantage function, which together construct the action value function, as shown in formula (2):
[0057]
[0058] Among them, θ is the convolution layer parameter, α and β are the two fully connected layer parameters. V(s; θ, β) is the state value function, and the remaining second half of formula (2) is the action advantage flow function, which is a single action advantage function minus the average of all action advantage functions in a certain state. However, the action advantage flow function shown in formula (2) cannot reflect the comprehensive characteristics of the sample state data. For this reason, the present invention modifies formula (2) and introduces the standard deviation to replace the mean operation, which can more intuitively reflect the fluctuation size of these action advantage functions. The new action value function proposed by the present invention is shown in formula (3):
[0059]
[0060] Among them, Q π () represents the action value function, V represents the state value function, A represents the action advantage function, A represents the action set in reinforcement learning, s represents the state in reinforcement learning, a represents the action in reinforcement learning, θ represents the convolutional layer parameters in the Dueling DQN algorithm, α represents the first fully connected layer parameters in the Dueling DQN algorithm, β represents the second fully connected layer parameters in the Dueling DQN algorithm, a' represents any action in the action set A, It represents the average value of the action advantage function. This operation can ensure that the relative order of the advantage functions of each action in this state remains unchanged and narrow the range of the Q value, thereby improving the stability of the algorithm. sqrt() represents the square root, and A represents the size of the action space.
[0061] (2) Action: Combined with the strategy, the agent obtains the behavior, where Action is a finite set, and each element a∈Action represents the action taken by the agent. In software privacy compliance detection, a represents the type of edge of the heterogeneous graph data node (the connection between the node of the API class and the node of the permission class in the heterogeneous graph is a type of edge). The agent selects different behaviors a in combination with the strategy to construct a meta-path. For example, the node API can select different edge types to generate two meta-paths: API→Perm and API→Class.
[0062] (3) State: Combined with the behavior generated by the agent, the current state of reinforcement learning is obtained, which represents the possible state explored by the agent in the environment in the reinforcement learning framework. In the present invention, s represents the state in reinforcement learning, which is the impact of the meta-path constructed by node categories on the classification results of non-compliant software. For example, the meta-path API→Class, which contains two types of node categories, can generate the corresponding sample representation (i.e., node vector representation) state for the sample in combination with the meta-path reinforcement learning.
[0063] (4) Reward: The reward function R of reinforcement learning is the result of the interaction between the agent and the environment by taking action A, and guides the reinforcement learning to the next step of training. In the present invention, the reward function R refers to the impact of reinforcement learning on the privacy compliance detection results when selecting a certain node type as part of the meta-path. As shown in formula (4):
[0064]
[0065] Among them, Eva() is the performance value of the node representation learned by the graph representation model in the downstream detection task, R(s t ,a t ) represents the change in performance and loss value of the model in the previous round of model training. Loss() is the loss function of this reinforcement learning strategy, and λ and γ are the control parameters of the performance difference and loss function difference.
[0066] Next step status t+1 It is generated by the new meta-path constructed by the agent's strategy (policy) combined with the reward value according to the action a determined by the current environment.
[0067] The loss function of this reinforcement learning strategy is shown in formula (5):
[0068] Loss(θ)=E π [(Q π (s,a:θ)-Q π (s,a)) 2 ] (5)
[0069] Among them, Loss() represents the loss function in reinforcement learning, E π [] represents the expected function, Q π () represents the action-value function, s represents the state in reinforcement learning, a represents the action in reinforcement learning, and θ represents the convolutional layer parameters in the DuelingDQN algorithm.
[0070] That is, the minimum difference function between the model's predicted Q value and the target Q value is used as the loss function, and the parameter θ is optimized through the back-propagation mechanism.
[0071] In the above reinforcement learning training process, as time t changes, the length of the meta-path generated in each iteration will continue to change. The meta-path generated at each step will guide the sample to embed the path instance and generate the sample path representation for software privacy compliance training and testing. In addition, in order to speed up the performance and efficiency of the model, the t-th reinforcement learning s t After the normalization operation, the t+1th iteration is performed. First, the graph representation model is used to obtain the vector representation of each node in the t-th dimension path instance, and then the normalization operation is performed using formula (6). Formula (6) is as follows:
[0072]
[0073] Among them, Emb mean and Emb std are the mean and standard deviation of the previous reinforcement learning states, respectively.
[0074] In actual application, the path instance corresponding to each sample software is generated according to the meta-path corresponding to each sample software, specifically: the meta-path is used as a template to generate the path instance.
[0075] In practical applications, the graph representation model is as follows:
[0076] First, since the heterogeneous graph data contains four different types of nodes, in order to facilitate the quantitative calculation of the detection model, it is necessary to map these different types of nodes into the same vector space. The conversion process is shown in formula (7):
[0077] Emb=W type *v type (7)
[0078] Among them, Emb is the vector representation of the heterogeneous graph data node after mapping, including Emb[i], i represents the node i in the heterogeneous graph, v type The vector before mapping is represented as the initial representation of the node. type contains four types of nodes, type∈(Name,API,Class,Perm). W is the vector transformation matrix, and different types of nodes have different transformation matrices.
[0079] In addition, since the node call structure in the software non-compliant behavior contains different semantic features, the detection model needs to use the attention network to distinguish the weights between nodes. The sample path instance P is generated using the meta-path X as a template, and its formula (8) is as follows:
[0080] {P1, P2, ...P n ,}:X→G (8)
[0081] That is, the meta-path is mapped as a template into the heterogeneous graph to obtain node instances with the same meta-node category.
[0082] In addition, the attention weight calculation of the node pair (i, j) in the path instance P is shown in formula (9):
[0083]
[0084] Among them, σ is the softmax activation function, is the attention value of the node pair (i, j) in the meta-path X. Att is the computational node attention mechanism. Subsequently, the model aggregates the attention values and node embedding vectors between nodes to calculate the final representation of the node. The instance nodes of the meta-path X are aggregated according to formula (10):
[0085]
[0086] where G(i) includes v in path instance P i The connected graph nodes are represented by σ, and σ is the softmax activation function. Finally, the updated Emb'[i] data of the graph node contains the aggregated information of the surrounding nodes.
[0087] The detection model takes the vector representation of each node in these path instances as input and continuously optimizes the parameters of the classifier (graph embedding model) through back propagation. The model is trained using the loss function, as shown in formula (11):
[0088]
[0089] Among them, x represents the category of training sample data, that is, the detection result of sample software, and y iis the initial one-hot label vector of the sample path, that is, the vector representation of the i-th node output by the graph representation model, and Emb'[i] is the predicted vector representation of the target node, that is, the predicted vector representation of the i-th node predicted by the graph embedding model.
[0090] The software privacy compliance detection method proposed in the present invention is specifically a software privacy compliance detection method based on path representation of reinforcement learning. First, the detection model extracts the call sequences between APP and API, API and API, API and Class, API and permission, and APP and permission by extracting the effective internal structural features of the software, and jointly constructs the heterogeneous graph data of the sample. The representation ability of the heterogeneous graph data is better than that of the traditional detection method, and can fully reflect the software behavior of the sample. Subsequently, reinforcement learning is used to generate relevant meta-paths and path instances for each software sample, and the nodes in the path instance are embedded and represented using the graph representation model. Finally, the vector of the sample embedding representation is the improvement value of the classification performance of the classifier, as shown in formula (4) as the reward function value in reinforcement learning, thereby affecting the selection of the next round of reinforcement learning actions, and further improving the detection effect of reinforcement learning. The present invention can effectively retain the structural characteristics of the software by constructing the path representation of the sample, thereby automatically detecting the non-compliant behavior of the software, and providing a new privacy compliance detection method for detection personnel.
[0091] The present invention also provides a software privacy compliance detection system, such as Figure 1 As shown, including:
[0092] The dataset construction module labels the non-compliant software reported by the authorities and the reasons for the official notifications, and reverse compiles the software to be tested to obtain API features, API and permission features.
[0093] A heterogeneous graph construction module is used to construct heterogeneous graph data based on the call sequences between APP and API, between API and API, between APP and permission, and between API and permission.
[0094] The reinforcement learning path instance generation module combines reinforcement learning to generate relevant meta-paths for samples, and uses the meta-paths as templates to generate path instances for samples.
[0095] The reinforcement learning compliance detection training module is connected to the sample path instance generation module. It is used for vector embedding of sample path instances and calculation of reinforcement learning reward function values. The reward value guides the selection of the next reinforcement learning action and obtains the software privacy compliance detection model.
[0096] The compliance detection module is connected with the compliance detection training module to detect and classify software privacy compliance and ultimately detect non-compliant behavior of the software.
[0097] The beneficial effects of the present invention can be mainly divided into the following three points:
[0098] 1. An effective supervised software privacy compliance dataset is constructed, providing effective data support for the field of privacy compliance detection. 2. The present invention proposes a new software compliance detection method. 3. The detection accuracy of the present invention is higher than that of related models.
[0099] First, the present invention proposes a new software privacy compliance detection model. Since the current main software privacy compliance detection method is to perform manual detection through code plug-in scripts, the method requires the detection personnel to have a strong professional background, and the detection method requires the writing of corresponding scripts, that is, non-automated detection. Therefore, the method proposed by the present invention can automatically detect, and the detection time is shorter.
[0100] Secondly, the detection accuracy of the present invention is higher. The previous two related research models are compared: traditional machine learning algorithms and privacy compliance detection models based on heterogeneous graph data representation. Experiments show that the prediction accuracy of the present invention can be improved by more than 20% in the software privacy compliance classification task. In addition, the binary classification detection accuracy of software privacy compliance reaches 76%.
[0101] In one embodiment, a computer device is also provided, including a memory and a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the software privacy compliance detection method described in the above method embodiments is implemented. The computer device may be a database, and its internal structure diagram may be as shown in FIG. Figure 5 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store pending transactions. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data processing method is implemented.
[0102] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the software privacy compliance detection method described in the above method embodiments is implemented.
[0103] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the software privacy compliance detection method described in the above method embodiments.
[0104] It should be noted that the object information (including but not limited to object device information, object personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the object or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards.
[0105] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited thereto.
[0106] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0107] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A software privacy compliance detection method, characterized in that: include: Extract sample features corresponding to each sample software; the sample features include: a call sequence between APP and target API, a call sequence between target API and target API, a call sequence between target API and Class, a call sequence between target API and target permission, and a call sequence between APP and target permission; the target API is an API related to user privacy information; the target permission is a permission related to user privacy; the sample software is software that violates the privacy compliance policy; A heterogeneous graph corresponding to each sample software is constructed based on the sample features corresponding to each sample software; the nodes of the heterogeneous graph include APP, API, Class and permission; the edge of the heterogeneous graph is a call sequence between two nodes connected by the edge; In the current iteration round, reinforcement learning is used to process each of the heterogeneous graphs according to the reinforcement learning reward function value in the previous iteration round to obtain the meta-path corresponding to each sample software in the current iteration round; Generate the path instance corresponding to each sample software in the current iteration round according to the meta-path corresponding to each sample software in the current iteration round, and use the graph representation model to process the path instance corresponding to each sample software in the current iteration round to obtain the vector representation of each node in the path instance corresponding to each sample software in the current iteration round; The software privacy compliance detection model in the previous iteration round is trained using the training set to obtain the software privacy compliance detection model in the current iteration round; the training set includes the vector representation of each node in the path instance corresponding to each sample software in the current iteration round and the detection result of each sample software, and the detection result includes violation of the privacy compliance policy and non-violation of the privacy compliance policy; the software privacy compliance detection model in the initial iteration round is a graph embedding model; Calculate the value of the reinforcement learning reward function under the current iteration round according to the vector representation of each node in the path instance corresponding to each sample software under the current iteration round, update the iteration round, and enter the next iteration until the set iteration round is reached; Inputting sample features corresponding to the software to be tested into the software privacy compliance detection model in the last iteration round to obtain the detection result of the software to be tested; The action-value function in reinforcement learning is: Among them, Q π () represents the action value function, V() represents the state value function, A() represents the action advantage function, A represents the action set in reinforcement learning, s represents the state in reinforcement learning, a represents the action in reinforcement learning, θ represents the convolutional layer parameters in the Dueling DQN algorithm, α represents the first fully connected layer parameters in the Dueling DQN algorithm, β represents the second fully connected layer parameters in the Dueling DQN algorithm, a' represents any action in A, represents the average value of the action advantage function, sqrt() represents the square root, and |A| represents the size of the action space.
2. The software privacy compliance detection method according to claim 1, characterized in that: In the current iteration round, reinforcement learning is used to process each of the heterogeneous graphs according to the reinforcement learning reward function value in the previous iteration round to obtain the meta-path corresponding to each sample software in the current iteration round, specifically: In the current iteration round, the edges in the heterogeneous graph are used as actions in the reinforcement learning, and the heterogeneous graph is used as environmental data in the reinforcement learning. Reinforcement learning is used to extract a sample path for each sample from the heterogeneous graph according to the reinforcement learning reward function value in the previous iteration round.
3. The software privacy compliance detection method according to claim 1, characterized in that: The loss function in reinforcement learning is Loss(θ)=E π [(Q π (s,a;θ)-Q π (s,a)) 2 ], Among them, Loss() represents the loss function in reinforcement learning, E π [] represents the expected function, Q π () represents the action-value function, s represents the state in reinforcement learning, a represents the action in reinforcement learning, and θ represents the convolutional layer parameters in the DuelingDQN algorithm.
4. The software privacy compliance detection method according to claim 1, characterized in that: The loss function in the process of using the training set to train the software privacy compliance detection model in the previous iteration to obtain the software privacy compliance detection model in the current iteration is: in, represents the loss function for training the graph embedding model, x represents the detection result of the sample software, y i represents the vector representation of the i-th node output by the graph representation model, and Emb'[i] represents the predicted vector representation of the i-th node predicted by the graph embedding model.
5. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the software privacy compliance detection method described in any one of claims 1 to 4.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the software privacy compliance detection method described in any one of claims 1 to 4 is implemented.
7. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the software privacy compliance detection method described in any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
APP privacy compliance detection method and device, computer equipment and storage medium
CN111835756A
Application privacy compliance detection method and device
CN116305176A