Application processing method and apparatus, storage medium, and electronic device

CN122653684APending Publication Date: 2026-08-28HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610911388.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-23
Publication Date
2026-08-28

AI Technical Summary

Technical Problem

[0003]然而,当前分析方法在面对规模庞大且经过高强度代码混淆的现代应用程序时,效率低下问题突出,高度依赖人工经验,单次完整分析往往耗时漫长

Benefits of technology

[0046]本申请提供的一种应用程序处理方法、装置、存储介质及电子设备,所述方法包括:获取应用程序的第一版本与第二版本的二进制程序包;提取所述第一版本与第二版本的二进制程序包中的原始代码结构;基于所述原始代码结构,识别所述第一版本与所述第二版本之间的种子元素对,每个所述种子元素对中的两个种子元素满足预设映射条件;基于所述种子元素对,构建所述第一版本与第二版本之间的代码元素关系映射表;基于所述代码元素关系映射表,将针对所述第一版本的语义化推导结果迁移至所述第二版本的对应代码元素上,所述语义推导结果包括从所述第一版本的原始代码结构中的代码元素到具有业务语义的命名之间的映射关系。本申请通过构建版本间代码元素映射表,实现了逆向推导成果的跨版本复用,同时,通过聚合多版本遗留的未混淆符号,增强了系统性反混淆能力。显著降低了人工成本与对专家经验的依赖,提升了逆向工程分析的效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122653684A_ABST
    Figure CN122653684A_ABST
Patent Text Reader

Abstract

The application provides an application processing method and device, a storage medium and an electronic device, relates to the technical field of data processing, and specifically can acquire a binary program package of a first version and a second version of an application; extracts original code structures in the binary program packages of the first version and the second version; based on the original code structures, identifies seed element pairs between the first version and the second version, two seed elements in each seed element pair satisfying a preset mapping condition; based on the seed element pairs, constructs a code element relationship mapping table between the first version and the second version; and based on the code element relationship mapping table, migrates a semantic derivation result for the first version to corresponding code elements of the second version, the semantic derivation result including a mapping relationship between code elements in the original code structure of the first version and naming with business semantics. The software analysis efficiency can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to an application processing method, apparatus, storage medium, and electronic device. Background Technology

[0002] Reverse engineering is one of the core technologies in the field of information security. It analyzes the binary packages of software to understand its internal structure, logic and potential risks, and is widely used in scenarios such as vulnerability discovery and malware analysis.

[0003] However, current analysis methods are inefficient when dealing with large-scale modern applications with heavily obfuscated code, heavily reliant on human experience, and often time-consuming for a single complete analysis. Summary of the Invention

[0004] In view of this, this application provides an application processing method, apparatus, storage medium, and electronic device, which can effectively improve software analysis efficiency. The specific solution is as follows:

[0005] An application processing method, comprising:

[0006] Obtain the binary packages for both the first and second versions of the application;

[0007] Extract the original code structure from the binary packages of the first and second versions;

[0008] Based on the original code structure, seed element pairs between the first version and the second version are identified, and the two seed elements in each seed element pair satisfy a preset mapping condition.

[0009] Based on the seed element pairs, construct a code element relationship mapping table between the first version and the second version;

[0010] Based on the code element relationship mapping table, the semantic inference results for the first version are migrated to the corresponding code elements for the second version. The semantic inference results include the mapping relationship between code elements in the original code structure of the first version and names with business semantics.

[0011] Optionally, in the above method, identifying the seed element pair between the first version and the second version based on the original code structure includes:

[0012] In the original code structure of the first and second versions, query classes, global methods or global variables with the same name to obtain the first type of candidate seed element pairs;

[0013] In the original code structure of the first version and the second version, code elements containing the same constant are searched to obtain a second type of candidate seed element pairs; the constant includes strings, numbers or feature instruction sequences whose reference frequency is lower than a preset threshold in their respective versions.

[0014] Based on preset filtering rules, the first type of candidate seed element pairs and the first type of candidate seed element pairs are verified, and the candidate seed element pairs that pass the verification are determined as seed element pairs.

[0015] Optionally, in the above method, constructing a code element relationship mapping table between the first version and the second version based on the seed element pairs includes:

[0016] Add all the seed element pairs and their corresponding initial weights to the mapping relationship pool;

[0017] Starting with the current pair of elements to be expanded in the mapping relationship pool, traverse and analyze the candidate code elements associated with their context, and calculate the association weight of the candidate mapping pair composed of the candidate code elements based on the structural feature similarity.

[0018] Candidate mapping pairs with association weights higher than a preset addition threshold are added as new seed element pairs to the mapping relationship pool;

[0019] Seed element pairs in the mapping relationship pool are filtered, and a code element relationship mapping table is constructed based on the filtered seed element pairs.

[0020] Optionally, in the above method, the step of filtering the seed element pairs in the mapping relationship pool and constructing a code element relationship mapping table based on the filtered seed element pairs includes:

[0021] Detect whether there are any element pairs to be expanded in the mapping relationship pool;

[0022] If there are still element pairs to be expanded in the mapping relationship pool, then return to the step of starting with the current element pairs to be expanded in the mapping relationship pool, traversing and analyzing the candidate code elements associated with their context, and calculating the association weight of the candidate mapping pairs composed of the candidate code elements based on structural feature similarity.

[0023] If there are no element pairs to be expanded in the mapping relationship pool, then the seed element pairs in the mapping relationship pool are filtered, and a code element relationship mapping table is constructed based on the filtered seed element pairs.

[0024] Optionally, in the above method, the step of migrating the semantic derivation result for the first version to the corresponding code element in the second version based on the code element relationship mapping table includes:

[0025] Obtain the semantic derivation result of the first version;

[0026] For each target code element in the original code structure of the second version, the code element relationship mapping table is queried to determine the source code element corresponding to the target code element in the first version; the semantic name corresponding to the source code element is extracted from the semantic derivation result of the first version; the extracted semantic name is assigned to the target code element in the second version to complete the semantic derivation result migration of the target code element.

[0027] Optionally, in the above method, obtaining the semantic derivation result of the first version includes:

[0028] Reverse engineering the first version of the binary package to obtain the semantic derivation results of the first version.

[0029] An application processing device, comprising:

[0030] The acquisition unit is used to acquire the binary packages of the first and second versions of the application.

[0031] An extraction unit is used to extract the original code structure from the first and second version binary packages;

[0032] The identification unit is used to identify seed element pairs between the first version and the second version based on the original code structure, wherein the two seed elements in each seed element pair satisfy a preset mapping condition.

[0033] A construction unit is used to construct a code element relationship mapping table between the first version and the second version based on the seed element pairs;

[0034] The migration unit is used to migrate the semantic inference results for the first version to the corresponding code elements of the second version based on the code element relationship mapping table. The semantic inference results include the mapping relationship between code elements in the original code structure of the first version and names with business semantics.

[0035] Optionally, in the aforementioned apparatus, the identification unit includes:

[0036] The first execution subunit is used to query classes, global methods, or global variables with the same name in the original code structure of the first version and the second version to obtain the first type of candidate seed element pairs.

[0037] The second execution subunit is used to search for code elements containing the same constant in the original code structure of the first version and the second version to obtain a second type of candidate seed element pair; the constant includes strings, numbers or feature instruction sequences whose reference frequency is lower than a preset threshold in their respective versions.

[0038] The verification subunit is used to verify the first type of candidate seed element pairs and the first type of candidate seed element pairs based on preset filtering rules, and to determine the candidate seed element pairs that pass the verification as seed element pairs.

[0039] Optionally, the building unit in the aforementioned apparatus includes:

[0040] The third execution subunit is used to add all the seed element pairs and their corresponding initial weights to the mapping relationship pool;

[0041] The fourth execution subunit is used to traverse and analyze the candidate code elements associated with the current element pair to be expanded in the mapping relationship pool, starting from the candidate code element pair to be expanded in the mapping relationship pool, and calculate the association weight of the candidate mapping pair composed of the candidate code elements based on the structural feature similarity.

[0042] The fifth execution subunit is used to add candidate mapping pairs with association weights higher than a preset addition threshold as new seed element pairs to the mapping relationship pool;

[0043] The filtering subunit is used to filter the seed element pairs in the mapping relationship pool and construct a code element relationship mapping table based on the filtered seed element pairs.

[0044] A storage medium includes storage instructions, wherein, when the instructions are executed, the device on which the storage medium resides executes the application processing method described above.

[0045] An electronic device includes a memory and one or more instructions, wherein one or more instructions are stored in the memory and configured to be executed by one or more processors using the application processing method described above.

[0046] This application provides an application processing method, apparatus, storage medium, and electronic device. The method includes: acquiring binary packages of a first version and a second version of the application; extracting the original code structure from the binary packages of the first and second versions; identifying seed element pairs between the first and second versions based on the original code structure, wherein the two seed elements in each seed element pair satisfy a preset mapping condition; constructing a code element relationship mapping table between the first and second versions based on the seed element pairs; and migrating the semantic derivation results for the first version to the corresponding code elements in the second version based on the code element relationship mapping table, wherein the semantic derivation results include the mapping relationship between code elements in the original code structure of the first version and names with business semantics. This application achieves cross-version reuse of reverse engineering results by constructing an inter-version code element mapping table. Simultaneously, by aggregating unobfuscated symbols left over from multiple versions, it enhances systematic deobfuscation capabilities. This significantly reduces manual labor costs and reliance on expert experience, and improves the efficiency of reverse engineering analysis. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0048] Figure 1 A flowchart of an application processing method provided in this application;

[0049] Figure 2 An example diagram of the original software structure provided in this application;

[0050] Figure 3 An example diagram of a software derivation structure provided in this application;

[0051] Figure 4 Another example diagram of the original software structure provided in this application;

[0052] Figure 5 A schematic diagram of the structure of an application processing device provided in this application;

[0053] Figure 6 This is a schematic diagram of the structure of an electronic device provided in this application. Detailed Implementation

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

[0055] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0056] This application provides an application processing method, which can be applied to an electronic device, such as a mobile terminal, tablet computer, or server. The flowchart of the method is shown below. Figure 1 As shown, it specifically includes:

[0057] S101: Obtain the binary packages for the first and second versions of the application.

[0058] In this embodiment, the application can be any software application, such as a mobile application, desktop application, or system component. The first version and the second version are versions of the same application released at different iteration points, and there is a code evolution relationship between them.

[0059] Optionally, a binary package refers to a file generated after software compilation and linking that can be directly loaded and executed in the corresponding computing environment.

[0060] S102: Extract the original code structure from the binary packages of the first and second versions.

[0061] In this embodiment, the original code structure refers to the underlying organizational information of the program restored after static disassembly or decompilation analysis of the binary program package.

[0062] Optionally, the original code structure includes, but is not limited to, classes, interfaces, methods, procedures, fields, global variables, and their calling relationships, inheritance relationships, and reference relationships.

[0063] In this embodiment, a decompilation tool can be used to extract the original code structure from the first and second versions of the binary package. The decompilation tool converts machine instructions or bytecode into intermediate representations or structural description data by parsing the format of the binary package.

[0064] S103: Based on the original code structure, identify the seed element pairs between the first version and the second version, wherein the two seed elements in each seed element pair satisfy a preset mapping condition.

[0065] In this embodiment, seed element pairs can be used to construct a mapping relationship between two versions. The seed element refers to the code element in the original code structure of the two versions that can represent the same entity.

[0066] Optionally, the preset mapping conditions are rules used to determine whether two elements can be directly matched. Exemplary conditions include: the elements are unobfuscated classes, global methods, or global variables with identical names; or, the elements are code structures containing the same unique constant, which can be a string, number, file magic number, or a specific instruction sequence, and the constant's reference frequency in its respective version is below a preset threshold. All combinations of elements satisfying any of the above conditions can be scanned and matched in the structure description data of the two versions to form an initial set of mapping pairs.

[0067] S104: Based on the seed element pairs, construct a code element relationship mapping table between the first version and the second version.

[0068] In this embodiment, the code element relationship mapping table is used to record the equivalent or corresponding relationships between code elements in the first version and those in the second version.

[0069] S105: Based on the code element relationship mapping table, the semantic inference results for the first version are transferred to the corresponding code elements of the second version. The semantic inference results include the mapping relationship between code elements in the original code structure of the first version and names with business semantics.

[0070] In this embodiment, the semantic derivation result is the business semantic name assigned to the code elements of the first version during reverse engineering analysis.

[0071] Specifically, a code element relationship mapping table can be used to automatically assign semantic names to code elements in the second version that have not yet been analyzed. The implementation is as follows: for any target code element in the second version, its corresponding source code element in the first version is searched in the code element relationship mapping table. If the search is successful, the business semantic name corresponding to that source code element is directly retrieved from the semantic derivation result dictionary of the first version and assigned to the target code element in the second version. In this way, the reverse analysis results of the first version can be efficiently reused in the second version, significantly improving the overall efficiency of continuous iterative analysis of the application and reducing costs. Simultaneously, by aggregating the mapping relationships of multiple historical versions and residual unobfuscated symbols, it is also possible to effectively combat obfuscation of a single version, achieving a systematic deobfuscation effect.

[0072] In one embodiment provided in this application, based on the above-described scheme, optionally, based on the original code structure, identifying seed element pairs between the first version and the second version includes:

[0073] In the original code structure of the first and second versions, query classes, global methods or global variables with the same name to obtain the first type of candidate seed element pairs;

[0074] In the original code structure of the first and second versions, code elements containing the same constants are searched to obtain the second type of candidate seed element pairs; constants include strings, numbers or characteristic instruction sequences whose reference frequency is lower than a preset threshold in their respective versions.

[0075] Based on the preset filtering rules, the first type of candidate seed element pairs and the first type of candidate seed element pairs are verified, and the candidate seed element pairs that pass the verification are determined as seed element pairs.

[0076] In this embodiment, the class names, global method names, or global variable names obtained after decompiling or statically analyzing the two versions can be compared. Specifically, during application development, some classes, global methods, or global variables may retain their names across different versions because they were not obfuscated or belong to referenced system libraries or third-party libraries. Classes, global methods, or global variables with completely identical names have a high degree of direct mapping reliability. In implementation, all class names, global method names, or global variable names in the first version can be traversed, and a precise match can be performed in the corresponding set of the second version. Successfully matched element pairs (such as class A in the first version and class A' with the same name in the second version) are recorded as the first type of candidate seed element pairs.

[0077] For example, a constant is a fixed value embedded in program code. Code elements can be classes, methods, or fields. Identical constants are those with exactly the same value and whose global reference frequency in their respective versions is less than a preset threshold. The preset threshold is used to define the uniqueness of a constant; for example, it can be set to 3 or 5 times.

[0078] Optionally, the feature instruction sequence can refer to the feature values ​​used during the initialization of a specific algorithm, or the specific instruction codes called by the operating system. Low-frequency constants contained within all code elements in each version can be extracted and hashed, and then the hash values ​​can be compared across versions to pair code elements with the same hash value, forming a second type of candidate seed element pair.

[0079] It's easy to understand that the candidate pairs obtained may contain false positives. For example, two classes with different functionalities might accidentally use the same constant; or, code refactoring between versions might result in classes with the same name but different functionality. Therefore, verification is necessary. Pre-defined filtering rules can include structural consistency checks. In implementation, contextual analysis can be performed on the two elements in a candidate pair, such as checking whether they are code elements of the same category, whether their direct parent classes or interfaces are the same, and whether the number of their main methods or fields matches. Only candidate pairs that pass such consistency checks can be confirmed as high-confidence seed element pairs.

[0080] In one embodiment provided in this application, based on the above-described scheme, optionally, a code element relationship mapping table between the first version and the second version is constructed based on seed element pairs, including:

[0081] S201: Add all seed element pairs and their corresponding initial weights to the mapping relationship pool;

[0082] S202: Starting with the current pair of elements to be expanded in the mapping relationship pool, traverse and analyze the candidate code elements associated with their context, and calculate the association weight of the candidate mapping pair composed of the candidate code elements based on the structural feature similarity.

[0083] S203: Add candidate mapping pairs with association weights higher than the preset addition threshold as new seed element pairs to the mapping relationship pool;

[0084] S204: Filter the seed element pairs in the mapping relationship pool, and construct a code element relationship mapping table based on the filtered seed element pairs.

[0085] In this embodiment, the seed element pairs in the mapping relationship pool are filtered, and a code element relationship mapping table is constructed based on the filtered seed element pairs, including:

[0086] Detect whether there are any element pairs to be expanded in the mapping relationship pool;

[0087] If there are still pairs of elements to be expanded in the mapping relationship pool, then return to the execution of step S205, which starts from the current pairs of elements to be expanded in the mapping relationship pool, traverses and analyzes the candidate code elements associated with their context, and calculates the association weight of the candidate mapping pairs composed of the candidate code elements based on the structural feature similarity.

[0088] If there are no element pairs to be expanded in the mapping relationship pool, then the seed element pairs in the mapping relationship pool are filtered, and a code element relationship mapping table is constructed based on the filtered seed element pairs.

[0089] In this embodiment, the initial weight is a quantified value representing the initial matching confidence of the pair of elements. For example, a seed pair consisting of unobfuscated classes with identical names can be assigned a high initial weight, such as 1.0, due to its extremely high determinism. For seed pairs obtained based on unique constant matching, a slightly higher initial weight, such as 0.8, can be assigned based on the rarity of the constant itself and the accuracy of the matching. The seed pairs and their weights are then added to the mapping relationship pool.

[0090] Specifically, the element pair to be expanded refers to the element pair retrieved from the mapping pool in each iteration for exploring new mappings. Context-related candidate code elements refer to other elements directly related to the elements in the current element pair in terms of program structure. For example, if the current element pair consists of two classes, their context-related candidate code elements can include: methods defined within the class, declared fields, inherited parent classes, or implemented interfaces. The analysis process needs to be performed in two versions: for element A in the current element pair in the first version, find its related elements A1, A2, ...; for the corresponding element B in the second version, find its related elements B1, B2, ... . Subsequently, based on structural feature similarity, the association weight of each possible (Ai, Bj) combination as a candidate mapping pair is evaluated. Structural feature similarity can include the similarity of method signatures, field types, access control modifiers, and local similarity of the call relationship graph between elements. This similarity can be calculated using predefined rules or functions, and the calculation result is used to calculate the association weight of the candidate mapping pair by combining the result with the weight of the current element pair itself.

[0091] In this embodiment, the preset inclusion threshold is a configurable threshold value used to filter out candidate mappings with low confidence. For example, this threshold can be set to 0.1 or 0.15. New mapping relationships discovered through high-confidence associations can be re-injected into the mapping relationship pool. These newly added seed element pairs will, in subsequent iterations, serve as new current element pairs to be expanded, triggering the next round of context exploration and gradually covering more code elements in both versions.

[0092] After the iterative expansion process is complete, the mapping pool may contain all the mappings added during the iterations, but it may contain conflicts or low-quality entries. Therefore, filtering is necessary. Filtering mainly includes two types of operations: first, conflict resolution, which means that when a code element (such as class X in the first version) maps to multiple candidate elements (such as classes Y and Z in the second version), the mapping pair with the highest association weight is retained; second, weight filtering, which means removing mapping pairs whose final association weight is lower than a higher and more stringent final confidence threshold.

[0093] After completing the iterative expansion and filtering described above, the remaining mapping pool contains verified, high-quality code element correspondences. At this point, all seed element pairs in the pool can be formatted and organized, for example, into a hash table or relational database table, where the key is the code element identifier of the first version, and the value is the corresponding code element identifier of the second version and its final weight. This structured correspondence table is the code element relationship mapping table.

[0094] In one embodiment provided in this application, based on the above-described scheme, optionally, based on a code element relationship mapping table, the semantic derivation result for the first version is transferred to the corresponding code element in the second version, including:

[0095] Obtain the semantic derivation result of the first version;

[0096] For each target code element in the original code structure of the second version, query the code element relationship mapping table to determine the source code element corresponding to the target code element in the first version; extract the semantic name corresponding to the source code element from the semantic derivation result of the first version; assign the extracted semantic name to the target code element in the second version to complete the migration of the semantic derivation result of the target code element.

[0097] In this embodiment, the semantic derivation result is obtained in advance through reverse engineering analysis of the first version of the binary package. Specific code elements from the original code structure of the first version, along with the corresponding names with clear business semantics, can be recorded.

[0098] Optionally, the target code element refers to the code element in the second version that is still in its original state and needs to be semantically annotated. The source code element corresponding to the target code element in the first version is obtained by looking up a table.

[0099] In this embodiment, after determining the source code element, a search can be performed in the semantic derivation result database of the first version to obtain the semantic name corresponding to the source code element. The semantic name is then assigned to the target code element in the second version to complete the migration of the semantic derivation result of the target code element.

[0100] In an alternative embodiment, based on the above scheme, the semantic derivation result of the first version can be obtained, which can be further explained as follows: reverse analysis of the binary package of the first version is performed to obtain the semantic derivation result of the first version.

[0101] In one embodiment provided in this application, based on the above-described scheme, optionally, obtaining the first version of the semantic derivation result includes:

[0102] Reverse engineering the first version of the binary package to obtain the semantic derivation results of the first version.

[0103] In this embodiment, the original code structure of a certain version i of the application can be denoted as Si={s1,s2,...,sn}, as follows: Figure 2 As shown, s1 to sn represent low-level elements such as classes and methods, and the semantic derivation result corresponding to Si is denoted as Ti={t1,t2,...,tn}, as follows. Figure 3 As shown, where t1 to tn are names with business semantics, the derivation process can be regarded as a mapping function f: Si→Ti. For the new version j of the application, such as Figure 4 As shown, its original structure Sj={s'1,s'2,...,s'm} has changed. If an equivalence mapping Mj→i can be established between the original structure Sj of version j and the original structure Si of version i (for example, M_j→i[s'1]=s1), then the derivation result Tj of version j can be largely reused from the result Ti of version i through the formula Tj(s)=Ti(Mj→i(s)). The construction scheme of this mapping Mj→i is denoted as Fapp, which is used to achieve cross-version reuse.

[0104] First, identify seed element pairs that can be directly mapped between the two versions, such as classes, global methods or global variables with identical names that are not obfuscated, or code elements that contain the same unique constants (such as frequently used specific strings, mathematical constants π, e, file magic numbers, algorithm feature values, etc.).

[0105] Second, initialize a mapping pool, adding these seed pairs and their initial weights. Then, starting with the mapping pairs currently to be expanded in the pool, analyze the contextual elements (such as methods and fields contained in a class, other methods called by a method) of each element in their respective versions, and calculate the association weight between newly discovered candidate element pairs based on structural feature similarity. The similarity weight is quantified and calculated according to a series of rules based on the code type (such as ELF or JVM bytecode). The rules consider factors such as symbol name, number of parameters, constant usage, call frequency, inheritance relationship, access characteristics, etc. For example, for two classes, if their package names and class names are exactly the same and not confused, they are given a high weight; if they both use the same constant with a reference frequency of less than 3 times, the weight is inversely proportional to the product of the reference frequency of the constant in the two versions. The calculated weights are superimposed on the weights of the parent mapping pair. Candidate pairs with weights higher than a preset threshold are added to the mapping pool, and this expansion process is iterated until no new high-weight mapping pairs can be found.

[0106] Specifically, for each existing element pair in the mapping relationship pool, denoted as AB value, other elements structurally closely related to the current element are searched within the original code structures of both the first and second versions. The feature similarity between these newly discovered candidate element pairs is calculated to obtain their equivalence probability (denoted as W_current) for the current examination. This probability is then multiplied by the existing weight of the parent element pair (denoted as W_parent) to calculate the final association weight of the new candidate pair (W = W_parent * W_current). The newly generated mapping relationship and its weight are added to the mapping relationship pool as the starting point for the next round of iterative expansion.

[0107] For example, suppose the AB value to be expanded is a pair of Fragment classes from two versions, with an initial weight W_parent of 1. When expanding their structural relationship, it is found that both classes contain a method called "getLayoutInflater". Feature comparison shows that these two methods have the same name and are not confused, but the number of parameters differs slightly. In this study, their equivalence probability W_current is determined to be 0.8. Therefore, this newly discovered getLayoutInflater method pair is considered a new candidate mapping pair, with an association weight W = 1 * 0.8 = 0.8, and is added to the pool. In subsequent iterations, when this getLayoutInflater method pair with a weight of 0.8 is used as a new AB value for expansion (at which point its weight becomes the new W_parent), if it is further found that the return values ​​of these two methods point to class c1 and class c2 respectively in the two versions, and based on the return value relationship, the equivalence probability W_current of this type pair is inferred to be 0.5, then the new class pair...<c1,c2> The association weight will be calculated as 0.8 * 0.5 = 0.4.

[0108] Fourth, post-processing is performed on the mapping pool: mapping pairs with too low weight are discarded, conflicts where one element maps to multiple elements are resolved, and the mapping with the highest weight is retained, ultimately generating a code element relationship mapping table between versions. Using this constructed mapping table, when analyzing a new version (version two), only the semantic derivation results of the old version (version one) need to be obtained. For each target code element in the new version, its corresponding source element in the old version is found by querying the mapping table. Then, the corresponding semantic name is extracted from the semantic derivation results of the old version and assigned to the target element in the new version, thereby achieving automatic batch migration of derivation results.

[0109] and Figure 1 Corresponding to the method described herein, embodiments of this application also provide an application processing device, applied to an electronic device, for processing... Figure 1 The specific implementation of the method is shown in the schematic diagram of the device. Figure 5 As shown, it includes:

[0110] Acquisition unit 501 is used to acquire the binary packages of the first and second versions of the application;

[0111] Extraction unit 502 is used to extract the original code structure from the first and second version binary packages;

[0112] The identification unit 503 is used to identify seed element pairs between the first version and the second version based on the original code structure, wherein the two seed elements in each seed element pair satisfy a preset mapping condition.

[0113] Construction unit 504 is used to construct a code element relationship mapping table between the first version and the second version based on seed element pairs;

[0114] Migration unit 505 is used to migrate the semantic inference results for the first version to the corresponding code elements in the second version based on the code element relationship mapping table. The semantic inference results include the mapping relationship between code elements in the original code structure of the first version and names with business semantics.

[0115] In one embodiment provided in this application, based on the above-described scheme, optionally, the identification unit 503 includes:

[0116] The first execution subunit is used to query classes, global methods, or global variables with the same name in the original code structure of the first and second versions to obtain the first type of candidate seed element pairs.

[0117] The second execution subunit is used to search for code elements containing the same constant in the original code structure of the first and second versions to obtain a second type of candidate seed element pair; the constant includes strings, numbers or feature instruction sequences whose reference frequency is lower than a preset threshold in their respective versions.

[0118] The verification subunit is used to verify the first type of candidate seed element pairs and the first type of candidate seed element pairs based on preset filtering rules, and to determine the candidate seed element pairs that pass the verification as seed element pairs.

[0119] In one embodiment provided in this application, based on the above-described solution, optionally, the construction unit includes:

[0120] The third execution subunit is used to add all seed element pairs and their corresponding initial weights to the mapping relationship pool;

[0121] The fourth execution subunit is used to traverse and analyze the candidate code elements associated with the current element pair to be expanded in the mapping relationship pool, and calculate the association weight of the candidate mapping pair composed of the candidate code elements based on the structural feature similarity.

[0122] The fifth execution subunit is used to add candidate mapping pairs with association weights higher than a preset addition threshold as new seed element pairs to the mapping relationship pool.

[0123] The filtering subunit is used to filter the seed element pairs in the mapping relationship pool and construct a code element relationship mapping table based on the filtered seed element pairs.

[0124] The specific principles and execution processes of each unit and module in the application processing device disclosed in the above embodiments of this application are related to... Figure 1The application processing method disclosed in the embodiments is the same, and can be found in the corresponding part of the application processing method provided in the above embodiments of this application, which will not be repeated here.

[0125] This application also provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-described application processing method or the above-described control method for a mobile device.

[0126] This application also provides an electronic device, the structural schematic diagram of which is shown below. Figure 6 As shown, it specifically includes a memory 601 and one or more instructions 602, wherein one or more instructions 602 are stored in the memory 601 and are configured to be executed by one or more processors 603 to perform the above-described application processing method.

[0127] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0128] Finally, it should be noted that in this paper, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0129] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.

[0130] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0131] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. 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 this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. An application processing method, characterized in that, include: Obtain the binary packages for both the first and second versions of the application; Extract the original code structure from the binary packages of the first and second versions; Based on the original code structure, seed element pairs between the first version and the second version are identified, and the two seed elements in each seed element pair satisfy a preset mapping condition. Based on the seed element pairs, construct a code element relationship mapping table between the first version and the second version; Based on the code element relationship mapping table, the semantic inference results for the first version are migrated to the corresponding code elements for the second version. The semantic inference results include the mapping relationship between code elements in the original code structure of the first version and names with business semantics.

2. The method according to claim 1, characterized in that, Based on the original code structure, seed element pairs between the first version and the second version are identified, including: In the original code structure of the first and second versions, query classes, global methods or global variables with the same name to obtain the first type of candidate seed element pairs; In the original code structure of the first version and the second version, code elements containing the same constant are searched to obtain a second type of candidate seed element pairs; the constant includes strings, numbers or feature instruction sequences whose reference frequency is lower than a preset threshold in their respective versions. Based on preset filtering rules, the first type of candidate seed element pairs and the first type of candidate seed element pairs are verified, and the candidate seed element pairs that pass the verification are determined as seed element pairs.

3. The method according to claim 1, characterized in that, The step of constructing a code element relationship mapping table between the first version and the second version based on the seed element pairs includes: Add all the seed element pairs and their corresponding initial weights to the mapping relationship pool; Starting with the current pair of elements to be expanded in the mapping relationship pool, traverse and analyze the candidate code elements associated with their context, and calculate the association weight of the candidate mapping pair composed of the candidate code elements based on the structural feature similarity. Candidate mapping pairs with association weights higher than a preset addition threshold are added as new seed element pairs to the mapping relationship pool; Seed element pairs in the mapping relationship pool are filtered, and a code element relationship mapping table is constructed based on the filtered seed element pairs.

4. The method according to claim 3, characterized in that, The step of filtering seed element pairs in the mapping relationship pool and constructing a code element relationship mapping table based on the filtered seed element pairs includes: Detect whether there are any element pairs to be expanded in the mapping relationship pool; If there are still element pairs to be expanded in the mapping relationship pool, then return to the step of starting with the current element pairs to be expanded in the mapping relationship pool, traversing and analyzing the candidate code elements associated with their context, and calculating the association weight of the candidate mapping pairs composed of the candidate code elements based on structural feature similarity. If there are no element pairs to be expanded in the mapping relationship pool, then the seed element pairs in the mapping relationship pool are filtered, and a code element relationship mapping table is constructed based on the filtered seed element pairs.

5. The method according to claim 1, characterized in that, The step of migrating the semantic derivation results for the first version to the corresponding code elements in the second version based on the code element relationship mapping table includes: Obtain the semantic derivation result of the first version; For each target code element in the original code structure of the second version, the code element relationship mapping table is queried to determine the source code element corresponding to the target code element in the first version; the semantic name corresponding to the source code element is extracted from the semantic derivation result of the first version; the extracted semantic name is assigned to the target code element in the second version to complete the semantic derivation result migration of the target code element.

6. The method according to claim 5, characterized in that, The step of obtaining the semantic derivation result of the first version includes: Reverse engineering the first version of the binary package to obtain the semantic derivation results of the first version.

7. An application processing apparatus, characterized in that, include: The acquisition unit is used to acquire the binary packages of the first and second versions of the application. An extraction unit is used to extract the original code structure from the first and second version binary packages; The identification unit is used to identify seed element pairs between the first version and the second version based on the original code structure, wherein the two seed elements in each seed element pair satisfy a preset mapping condition. A construction unit is used to construct a code element relationship mapping table between the first version and the second version based on the seed element pairs; The migration unit is used to migrate the semantic inference results for the first version to the corresponding code elements of the second version based on the code element relationship mapping table. The semantic inference results include the mapping relationship between code elements in the original code structure of the first version and names with business semantics.

8. The apparatus according to claim 7, characterized in that, The identification unit includes: The first execution subunit is used to query classes, global methods, or global variables with the same name in the original code structure of the first version and the second version to obtain the first type of candidate seed element pairs. The second execution subunit is used to search for code elements containing the same constant in the original code structure of the first version and the second version to obtain a second type of candidate seed element pair; the constant includes strings, numbers or feature instruction sequences whose reference frequency is lower than a preset threshold in their respective versions. The verification subunit is used to verify the first type of candidate seed element pairs and the first type of candidate seed element pairs based on preset filtering rules, and to determine the candidate seed element pairs that pass the verification as seed element pairs.

9. A storage medium, characterized in that, The storage medium includes storage instructions, wherein, when the instructions are executed, the device where the storage medium is located is controlled to perform the application processing method as described in any one of claims 1 to 6.

10. An electronic device, characterized in that, It includes memory, and one or more instructions, wherein one or more instructions are stored in memory and configured to be executed by one or more processors as described in any one of claims 1 to 6.