Android Program Polymorphism Detection and Processing Methods and Systems

By acquiring multiple states of an Android program from a terminal device and performing detection model calculations, the problem of the inability to effectively detect multiple states of an Android program in existing technologies is solved, thereby improving the security of Android programs.

CN116127458BActive Publication Date: 2026-11-17SHENZHEN HAIYUNAN NETWORK SECURITY TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310126413.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-08
Publication Date
2026-11-17
Estimated Expiration
2043-02-08

AI Technical Summary

Technical Problem

Existing technical solutions cannot effectively detect the various states of Android programs, thus affecting their security.

Method used

By acquiring various states of the Android program to be tested from the terminal device, calling the corresponding detection model to collect data and perform calculations, if the calculation results all meet the security requirements, the program is determined to be qualified for testing.

Benefits of technology

It implements polymorphism detection for Android programs, thereby improving the security of Android programs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116127458B_ABST
    Figure CN116127458B_ABST
Patent Text Reader

Abstract

This application provides a method and system for detecting polymorphism in Android programs. The method includes: a terminal device acquiring a first program to be detected and determining n states corresponding to the first program; the terminal device calling n detection models corresponding to the n states, collecting n sets of data corresponding to the n states, with each set of data corresponding to one state, and combining each set of data into n input data; the terminal device inputting the n input data into the n detection models to calculate n calculation results; if all n calculation results meet the security requirements, the first program is determined to be qualified for detection. The technical solution provided by this application has the advantage of high security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the Internet and data fields, specifically to a method and system for detecting and processing polymorphism in Android programs. Background Technology

[0002] Android programs refer to applications running the Android system. With the rise of smartphones, more and more phones are using the Android system and employing programs to obtain information from multiple sources. As Android programs become more feature-rich, they also enter more and more states. Existing technologies are unable to detect the state of Android programs, thus affecting their security. Summary of the Invention

[0003] This invention provides a method and system for detecting polymorphism in Android programs, which detects the state of Android programs and improves their security.

[0004] In a first aspect, embodiments of the present invention provide an Android program polymorphism detection and processing method, the method comprising the following steps:

[0005] The terminal device acquires the first program to be detected and determines the n states corresponding to the first program.

[0006] The terminal device calls n detection models corresponding to n states, collects n sets of data corresponding to the n states respectively, and each set of data corresponds to one state. The data of each set of n sets of data is combined into n input data.

[0007] The terminal device inputs n input data into n detection models to obtain n calculation results. If all n calculation results meet the safety requirements, the first procedure detection is deemed qualified.

[0008] Secondly, an Android program polymorphism detection and processing system is provided, the system comprising:

[0009] The acquisition unit is used to acquire the first program to be detected and determine the n states corresponding to the first program.

[0010] The processing unit is used to call n detection models corresponding to n states, collect n sets of data corresponding to the n states respectively, with each set of data corresponding to one state, and combine each set of data into n input data; input the n input data into the n detection models respectively to calculate n calculation results; if all n calculation results meet the safety requirements, the first procedure is determined to be qualified.

[0011] Thirdly, a computer-readable storage medium is provided that stores a program for electronic data interchange, wherein the program causes a terminal to execute the method provided in the first aspect.

[0012] Implementing the embodiments of the present invention has the following beneficial effects: A terminal device acquires a first program to be detected and determines n states corresponding to the first program; the terminal device calls n detection models corresponding to the n states, and collects n sets of data corresponding to the n states, with each set of data corresponding to one state; each set of data is combined into n input data; the terminal device inputs the n input data into the n detection models for calculation to obtain n calculation results; if all n calculation results meet security requirements, the first program is determined to be qualified. The technical solution of this application can perform detection separately using detection models corresponding to each state, thus enabling separate detection of multiple states of the application, thereby achieving security detection of Android programs and improving the security of Android programs. Attached Figure Description

[0013] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0014] Figure 1 This is a structural diagram of a terminal device;

[0015] Figure 2 This is a flowchart illustrating an Android program polymorphism detection and processing method provided in this application;

[0016] Figure 3 This is a schematic diagram of the structure of an Android program polymorphism detection and processing system provided in this application. Detailed Implementation

[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] The terms "first," "second," "third," and "fourth," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0019] In this document, the term "embodiment" means that a particular feature, result, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0020] See Figure 1 , Figure 1 A terminal is provided, which can be an Android system terminal, such as... Figure 1 As shown, the aforementioned device may specifically include a processor, memory, communication circuitry, and a display screen. These components can be connected via a bus or other means; this application does not limit the specific connection method. The aforementioned terminal can be a personal computer, server, smartphone, tablet computer, etc.

[0021] Android programs, due to their increasing functionality, exhibit multiple states, such as a payment state, a video viewing state, and a page browsing state. Different states require different detection requirements. For instance, in the payment state, payment security is paramount; in the video state, video security is crucial; and in the browsing state, the security of extended links on the page is paramount. Therefore, the detection methods for the same program differ across these states, necessitating a polymorphic detection approach for program evaluation.

[0022] The technical solution of this application is to detect polymorphism in Android programs, that is, to upgrade or supplement the Android program or Android system by adding a patch or upgrade package to the source code of the Android program.

[0023] See Figure 2 , Figure 2 This application provides a flowchart illustrating an Android program polymorphism detection and processing method, which is executed by a terminal device. Figure 2As shown, it includes the following steps:

[0024] Step S201: The terminal device obtains the first program to be detected and determines the n states corresponding to the first program;

[0025] Step S202: The terminal device calls the n detection models corresponding to the n states, collects the n sets of data corresponding to the n states respectively, and each set of data corresponds to one state. The data of each set of n sets of data is combined into n input data.

[0026] In the example above, n is an integer greater than or equal to 2, and the states mentioned above include, but are not limited to: payment status, video status, browsing status, etc.

[0027] Step S203: The terminal device inputs n input data into n detection models respectively to calculate n calculation results. If all n calculation results meet the safety requirements, the first procedure detection is deemed qualified.

[0028] For example, the above qualifying criteria indicate lower security.

[0029] The above calculation method can be performed using existing neural network models, and whether it complies with security standards can also be determined using existing methods, which will not be elaborated here.

[0030] Specifically, a safety threshold can be set. If the calculation result is greater than the safety threshold, it is considered safe; otherwise, it is not safe. Of course, n safety thresholds can also be set for n calculation results, which is not limited here.

[0031] The technical solution provided in this application allows a terminal device to acquire a first program to be tested and determine n states corresponding to that first program. The terminal device then calls n detection models corresponding to the n states, collecting n sets of data corresponding to each of the n states, with each set of data corresponding to one state. Each set of data is combined into n input data sets. The terminal device inputs these n input data sets into the n detection models for calculation, obtaining n calculation results. If all n calculation results meet security requirements, the first program is deemed to have passed the security test. This technical solution enables separate detection using detection models corresponding to each state, allowing for the separate detection of multiple states of the application, thereby improving the security of Android programs.

[0032] For example, the above method of assembling each of the n sets of data into n input data can specifically include:

[0033] Determine the dimensions [H1] and [W1] of the first input data corresponding to the first set of data. Extract x1 data points from one run of the first set of data. If x1 data points are greater than H1, compress them to H1 data points and input them into the first column of the first input data. If x1 data points are less than H1, expand them to H1 data points and input them into the first column of the first input data. Iterate through the data of subsequent runs of the first set of data to obtain the data of subsequent columns of the first input data, thus obtaining the first input data corresponding to the first set of data. Iterate through each set of data to obtain n input data points for each set of data. H1 is the height value, and W1 is the width value.

[0034] For example, the data that is compressed from x1 data points to H1 data points and then input into the first column of the first input data may specifically include:

[0035] Calculate the average of x1 data points to obtain x1', sort the x1 data points in descending order to obtain the first sequence, and extract the value w of the (x1-H1) / 2+1th data point in the first sequence. 前 Extract the value w of the (x1-H1) / 2+1th data point from the end of the first sequence. 后 Calculate |w 前 -x1'| and |w 后 -x1'|,α1=|w 前 -x1'| / |w 后 -x1'|, if α1 is within the preset range, delete the first (x1-H1) / 2 data and the last (x1-H1) / 2 data of the first sequence to obtain compressed H1 data, and input the H1 data into the first column of the first input data.

[0036] The preset range can be [0.8, 1.2], or other preset ranges. For values ​​within the preset range, i.e., the value of α1 is within [0.8, 1.2], and conversely, for values ​​outside the preset range, i.e., the value of α1 is not within [0.8, 1.2], the preset range must cross 1, i.e., the preset range must contain 1.

[0037] For example, the above methods may also include:

[0038] If α1 is not within the preset range and α1 is greater than 1, then w 前 Shift one position to the right, and move w 后 Shift one position forward and recalculate α1, the w of the above α1 前 w is the value shifted one position to the right. 后 The value to be shifted forward by one position; if α1 is within a preset range, the shifted value will be... 前、 w 后 The H1 data points between α1 and α1 are determined as the compressed H1 data; if α1 is not within the preset range, w前 Continue shifting one position to the right, and move w... 后 Continue shifting forward by one position until the calculated α1 falls within the preset range, then shift the shifted w... 前、 w 前 The H1 data points between them are determined to be compressed H1 data.

[0039] For example, the above methods may also include:

[0040] If α1 is not within the preset range and α1 is less than 1, then w 前 Move one position forward, and move w 后 Shift one position to the right and recalculate α1, the w of the above α1 前 w is the value shifted forward by one position. 后 The value shifted one position to the right; if α1 is within a preset range, the shifted value will be... 前、 w 后 The H1 data points between α1 and α1 are determined as the compressed H1 data; if α1 is not within the preset range, w 前 Continue moving forward one position, and move w... 后 Continue shifting one position to the right until the calculated α1 is within the preset range, then shift the shifted w... 前、 w 后 The H1 data points between them are determined to be compressed H1 data.

[0041] The above operation can remove redundant data in a single operation, and specifically remove values ​​with large offsets, thereby improving the accuracy of the input data and thus the accuracy of the calculation results.

[0042] For example, the data that is expanded from x1 data points to H1 data points and then input into the first column of the first input data may specifically include:

[0043] The x1 data points are sorted in descending order of collection time to obtain the second sequence. The average value y1 of any two adjacent values ​​is calculated from the second sequence. y1 is added between any two adjacent values ​​in the second sequence to obtain the third sequence. The average value y2 of any two adjacent values ​​is calculated from the third sequence. y2 is added between any two adjacent values ​​in the third sequence to obtain the fourth sequence. If the number of values ​​in the fourth sequence is not equal to H1, the numbers are continued to be inserted until the number of values ​​in the i-th sequence is equal to H1. The i-th sequence is then input into the first column of the first input data in sequence.

[0044] Similarly, the W direction of the first input data can also be processed in the same way as the H direction, and the remaining input data of the n input data can also be processed in other ways.

[0045] See Figure 3 , Figure 3An Android program polymorphism detection and processing system is provided, the system comprising:

[0046] The acquisition unit is used to acquire the first program to be detected and determine the n states corresponding to the first program.

[0047] The processing unit is used to call n detection models corresponding to n states, collect n sets of data corresponding to the n states respectively, with each set of data corresponding to one state, and combine each set of data into n input data; input the n input data into the n detection models respectively to calculate n calculation results; if all n calculation results meet the safety requirements, the first procedure is determined to be qualified.

[0048] For example, the processing unit is also used to determine the size [H1] and [W1] of the first input data corresponding to the first group of data, extract x1 data points from the first group of data in one run, if x1 data points are greater than H1, then compress x1 data points to H1 data points and input them into the first column of the first input data, if x1 data points are less than H1, then expand x1 data points to H1 data points and input them into the first column of the first input data, traverse the data of the subsequent runs of the first group of data to obtain the data of the subsequent columns of the first input data to obtain the first input data corresponding to the first group of data, and traverse each group of data to obtain n input data points for each group of data.

[0049] For example, the processing unit is also used to calculate the average of x1 data points to obtain x1', sort the x1 data points in descending order to obtain the first sequence, and extract the value w of the (x1-H1) / 2+1th data point in the first sequence. 前 Extract the value w of the (x1-H1) / 2+1th data point from the end of the first sequence. 后 Calculate |w 前 -x1'| and |w 后 -x1'|,α1=|w 前 -x1'| / |w 后 -x1'|, if α1 is within the preset range, delete the first (x1-H1) / 2 data and the last (x1-H1) / 2 data of the first sequence to obtain compressed H1 data, and input the H1 data into the first column of the first input data.

[0050] For example, the processing unit is also configured to, if α1 is not within a preset range and α1 is greater than 1, then w 前 Shift one position to the right, and move w 后 Shift one position forward and recalculate α1, the w of the above α1 前 w is the value shifted one position to the right. 后 The value to be shifted forward by one position; if α1 is within a preset range, the shifted value will be... 前、 w后 The H1 data points between α1 and α1 are determined as the compressed H1 data; if α1 is not within the preset range, w 前 Continue shifting one position to the right, and move w... 后 Continue shifting forward by one position until the calculated α1 falls within the preset range, then shift the shifted w... 前、 w 前 The H1 data points between them are determined to be compressed H1 data.

[0051] For example, the processing unit is also configured to, if α1 is not within a preset range and α1 is less than 1, then w 前 Move one position forward, and move w 后 Shift one position to the right and recalculate α1, the w of the above α1 前 w is the value shifted forward by one position. 后 The value shifted one position to the right; if α1 is within a preset range, the shifted value will be... 前、 w 后 The H1 data points between α1 and α1 are determined as the compressed H1 data; if α1 is not within the preset range, w 前 Continue moving forward one position, and move w... 后 Continue shifting one position to the right until the calculated α1 is within the preset range, then shift the shifted w... 前、 w 后 The H1 data points between them are determined to be compressed H1 data.

[0052] For example, the processing unit is also used to sort x1 data points in descending order of acquisition time to obtain a second sequence, arbitrarily select two adjacent values ​​from the second sequence to calculate the average value y1 of the two values, add y1 between two adjacent values ​​in the second sequence to obtain a third sequence, arbitrarily select two adjacent values ​​from the third sequence to calculate the average value y2 of the two values, add y2 between two adjacent values ​​in the third sequence to obtain a fourth sequence, and if the number of values ​​in the fourth sequence is not equal to H1, continue to insert values ​​until the number of values ​​in the i-th sequence is equal to H1, and input the i-th sequence sequentially into the first column of the first input data.

[0053] This invention also provides a computer storage medium storing a computer program for electronic data interchange, which causes a computer to perform some or all of the steps of any of the Android program polymorphism detection processing methods described in the above method embodiments.

[0054] This invention also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the Android program polymorphism detection processing methods described in the above method embodiments.

[0055] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, as some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are optional embodiments, and the actions and modules involved are not necessarily essential to the present invention.

[0056] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0057] In the embodiments provided in this application, it should be understood that the disclosed system can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between systems or units may be electrical or other forms.

[0058] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0059] The embodiments of the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for detecting and processing polymorphism in Android programs, characterized in that, The method includes the following steps: The terminal device acquires the first program to be detected and determines the n states corresponding to the first program. The terminal device calls n detection models corresponding to n states, collects n sets of data corresponding to the n states respectively, and each set of data corresponds to one state. The data of each set of n sets of data is combined into n input data. The terminal device inputs n input data into n detection models to obtain n calculation results. If all n calculation results meet the safety requirements, the first procedure detection is deemed qualified. The specific steps of assembling each of the n sets of data into n input data include: Determine the size [H1] and [W1] of the first input data corresponding to the first group of data. Extract x1 data points from the first group of data in one run. If x1 data points are greater than H1, compress x1 data points to H1 data points and input them into the first column of the first input data. If x1 data points are less than H1, expand x1 data points to H1 data points and input them into the first column of the first input data. Iterate through the data of subsequent runs of the first group of data to obtain the data of subsequent columns of the first input data. This will give you the first input data corresponding to the first group of data. Iterate through each group of data to obtain n input data points corresponding to each group of data. The data that is compressed from x1 data points to H1 data points and then input into the first column of the first input data specifically includes: Calculate the average of x1 data points to obtain x1', sort the x1 data points in descending order to obtain the first sequence, and extract the value w of the (x1-H1) / 2+1th data point in the first sequence. 前 Extract the value w of the (x1-H1) / 2+1th data point from the end of the first sequence. 后 Calculate |w 前 -x1' | and |w 后 -x1' |,α1=|w 前 -x1' | / |w 后 -x1' |, If α1 is within a preset range, delete the first (x1-H1) / 2 data and the last (x1-H1) / 2 data of the first sequence to obtain compressed H1 data, and input the H1 data into the first column of the first input data; If α1 is not within the preset range and α1 is greater than 1, then w 前 Shift one position to the right, and move w 后 Shift one position forward and recalculate α1, the w of the above α1 前 w is the value shifted one position to the right. 后 The value to be shifted forward by one position; if α1 is within a preset range, the shifted value will be... 前、 w 后 The H1 data points between α1 and α1 are determined as the compressed H1 data; if α1 is not within the preset range, w 前 Continue shifting one position to the right, and move w... 后 Continue shifting forward by one position until the calculated α1 falls within the preset range, then shift the shifted w... 前、 w 前 The H1 data points between them are determined to be the compressed H1 data; If α1 is not within the preset range and α1 is less than 1, then w 前 Move one position forward, and move w 后 Shift one position to the right and recalculate α1, the w of the above α1 前 w is the value shifted forward by one position. 后 The value shifted one position to the right; if α1 is within a preset range, the shifted value will be... 前、 w 后 The H1 data points between α1 and α1 are determined as the compressed H1 data; if α1 is not within the preset range, w 前 Continue moving forward one position, and move w 后 Continue shifting one position to the right until the calculated α1 is within the preset range, then shift the shifted w... 前、 w 后 The H1 data points between them are determined to be compressed H1 data.

2. The system used in the Android program polymorphism detection and processing method according to claim 1, characterized in that, The system includes: The acquisition unit is used to acquire the first program to be detected and determine the n states corresponding to the first program. The processing unit is used to call n detection models corresponding to n states, collect n sets of data corresponding to the n states respectively, with each set of data corresponding to one state, and combine each set of data into n input data; input the n input data into the n detection models respectively to calculate n calculation results; if all n calculation results meet the safety requirements, the first procedure is determined to be qualified.

Citation Information

Patent Citations

  • A neural network-based detection method and device

    CN109919744A