Error detection method and device for application program, equipment, medium and program product

By storing the class collection and inheritance relationship of the target application in the application view class, and performing member function prototype matching and code verification, the problem of how to quickly detect the wrong classes that cause Android application to crash is solved, and fast and accurate error positioning is achieved.

CN120196536APending Publication Date: 2025-06-24KE COM (BEIJING) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510259626.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-05
Publication Date
2025-06-24

AI Technical Summary

Technical Problem

How to quickly detect error classes that cause Android application crashes, especially when applications use plug-in technology.

Method used

By defining the application view class, the class collection and inheritance relationship of the target application are stored in the class, and the member function prototype matching and code line-by-line verification are performed to determine the error class.

Benefits of technology

It realizes the rapid and accurate detection of error classes that cause application crashes, improving the efficiency of error location and repair.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120196536A_ABST
    Figure CN120196536A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an application error detection method and device, equipment, a medium and a program product, and the method comprises the steps: defining an application view class for processing an application file set; storing an application program class set of the target application program and an inheritance relationship between application program classes in the application program class set into the application view class; on the basis of the application view classes, member function prototype matching and code line-by-line verification in member function bodies are carried out on all the application program classes in the application program class set; and determining an error class in the application class set based on the member function prototype matching result of each application class and a code line-by-line verification result in the member function body. According to the embodiment of the invention, the error class in the application program can be quickly and accurately determined.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to software testing technologies, and in particular, to an error detection method, apparatus, device, medium, and program product for an application program. Background Art

[0002] As the functions of mobile applications become increasingly complex, application programs (APPs) in the Android system gradually adopt plug-in technologies to achieve independent development, flexible deployment, and hot plug-in repair of business modules. After using a plug-in in an application program, when an error occurs in a class used by the application program or a class used by the plug-in, the application program crashes and needs to wait for the application program to be repaired before it can continue to run.

[0003] How to quickly detect the error class that causes the application program to crash is an urgent problem to be solved. Summary of the Invention

[0004] Embodiments of the present disclosure provide an error detection method, apparatus, device, medium, and program product for an application program to solve the above problems.

[0005] In a first aspect of the embodiments of the present disclosure, an error detection method for an application program is provided, including:

[0006] Defining an application view class for processing a set of application program files;

[0007] Storing a first set of application program classes of a target application program and inheritance relationships between the application program classes in the first set of application program classes into the application view class, where the target application program is configured with at least one plug-in;

[0008] Based on the application view class, performing member function prototype matching and line-by-line code verification in the member function bodies for each application program class in the first set of application program classes;

[0009] Based on the member function prototype matching results and line-by-line code verification results of each application program class, determining error classes in the first set of application program classes.

[0010] In some embodiments of the present disclosure, the operating system of the target application program is the Android system;

[0011] Before storing the first set of application program classes of the target application program and inheritance relationships between the application program classes in the first set of application program classes into the application view class, it includes:

[0012] Based on a preset code obfuscation tool and the framework of the Android system, extracting the inheritance relationships between the first set of application program classes and the application program classes from the Dalvik bytecode in the installation package of the target application program.

[0013] In some embodiments of the present disclosure, the member function prototype matching and line-by-line code verification in the member function bodies for each application class in the first application class set based on the application view class include:

[0014] Performing member function prototype matching for each application view class in the application view class based on the inheritance relationship between the application classes in the application view class;

[0015] Determining the class with unmatched member function prototype as the error class;

[0016] Verifying the name, parameter type, and number of parameters of each line of code function call in the member function body of each application view class in each application class;

[0017] Determining the application class with at least one line of code having an incorrect function call name, parameter type, or number of parameters as the error class.

[0018] In some embodiments of the present disclosure, it further includes:

[0019] Prompting the error classes in the first application class set.

[0020] In some embodiments of the present disclosure, it further includes:

[0021] Generating a compressed package including the first application class set based on the installation package of the target application;

[0022] Storing the second application class set corresponding to the target plugin of the target application and the inheritance relationship between the application classes in the second application class set into the application view class;

[0023] Based on the application view class and the compressed package, performing member function prototype matching and line-by-line code verification for each application class in the second application class set to determine the error classes in the second application class set.

[0024] A second aspect of the embodiments of the present disclosure provides an error detection device for an application, including:

[0025] A class definition module for defining an application view class for processing an application program file set;

[0026] A class information processing module for storing the first application class set of the target application and the inheritance relationship between the application classes in the first application class set into the application view class, where the target application is configured with at least one plugin;

[0027] A matching and verification module, configured to perform member function prototype matching and line-by-line verification of the code in the member function bodies for each application class in the first application class set based on the application view class;

[0028] An error detection module, configured to determine the error classes in the first application class set based on the member function prototype matching results and the line-by-line verification results of the code in the member function bodies for each application class.

[0029] In some embodiments of the present disclosure, the operating system of the target application is the Android system;

[0030] The class information processing module is further configured to extract the inheritance relationship between the first application class set and each application class from the Dalvik bytecode in the installation package of the target application based on a preset code obfuscation tool and the framework of the Android system.

[0031] In some embodiments of the present disclosure, the matching and verification module is configured to:

[0032] Perform member function prototype matching for each application view class in the application view class based on the inheritance relationship between each application class in the application view class;

[0033] Verify the name, parameter type, and number of parameters of each line of code function call in the member function body of each application view class in each application class;

[0034] Wherein, the error class determination module is configured to determine the class with unmatched member function prototype as the error class; the error class determination module is further configured to determine the application class with at least one line of code having an incorrect function call name, parameter type, or number of parameters as the error class.

[0035] In some embodiments of the present disclosure, the device further includes:

[0036] A prompt module, configured to prompt the error classes in the first application class set.

[0037] In some embodiments of the present disclosure, it further includes:

[0038] A compression module, configured to generate a compressed package including the first application class set based on the installation package of the target application;

[0039] Among them, the class information processing module is further configured to store the second application class set corresponding to the target plug-in of the target application program and the inheritance relationships between the application classes in the second application class set into the application view class; the matching and verification module is further configured to perform member function prototype matching and line-by-line code verification in the member function bodies on each application class in the second application class set based on the application view class and the compressed package; the error class determination module is further configured to determine the error classes in the second application class set based on the member function prototype matching results and the line-by-line code verification results of the member function bodies of the respective application classes.

[0040] In a third aspect of the embodiments of the present disclosure, there is provided an electronic device, including:

[0041] A memory for storing a computer program product;

[0042] A processor for executing the computer program product stored in the memory, and when the computer program product is executed, implementing the method described in the first aspect above.

[0043] In a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, implementing the method described in the first aspect above.

[0044] In a fifth aspect of the embodiments of the present disclosure, there is provided a computer program product, including computer program instructions, and when the computer program instructions are run by a processor, causing the processor to execute the method described in the first aspect above.

[0045] For the error detection method, device, equipment, medium and program product of the application program in the embodiments of the present disclosure, since the reasons for the application program to crash due to errors usually include errors in the classes used in the application program, the first application class set of the target application program and the inheritance relationships between the application classes in the first application class set are stored in the application view class, and then member function prototype matching and line-by-line code verification in the member function bodies are performed on each application class in the first application class set according to the application view class. Based on the member function prototype matching results and the line-by-line code verification results of the member function bodies of the respective application classes, the error classes in the first application class set that cause the target application program to crash can be quickly and accurately detected.

[0046] The technical solutions of the present disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. Description of the Drawings

[0047] The drawings forming a part of the specification depict the embodiments of the present disclosure and, together with the description, are used to explain the principles of the present disclosure.

[0048] With reference to the accompanying drawings, the present disclosure can be more clearly understood according to the following detailed description, where:

[0049] Figure 1 is a schematic flowchart of a method for error detection of an application in some embodiments of the present disclosure;

[0050] Figure 2 is a schematic flowchart of step S3 in some embodiments of the present disclosure;

[0051] Figure 3 is a schematic diagram of part of the process of a method for error detection of an application in some embodiments of the present disclosure;

[0052] Figure 4 is a schematic diagram of the principle for extracting the plug-in AppView in an application in an example of the present disclosure;

[0053] Figure 5 is a schematic diagram of the principle for detecting AppView in an example of the present disclosure;

[0054] Figure 6 is a block diagram of the structure of an error detection device for an application in some embodiments of the present disclosure;

[0055] Figure 7 is a block diagram of the structure of an error detection device for an application in other embodiments of the present disclosure;

[0056] Figure 8 is a block diagram of the structure of an electronic device in an embodiment of the present disclosure. Detailed Embodiments

[0057] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that: Unless otherwise specifically stated, the relative arrangements of components and steps, numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present disclosure.

[0058] Those skilled in the art can understand that terms such as "first" and "second" in the embodiments of the present disclosure are only used to distinguish different steps, devices, or modules, etc., and neither represent any specific technical meaning nor indicate an inevitable logical order between them.

[0059] It should also be understood that in the embodiments of the present disclosure, "a plurality of" may refer to two or more, and "at least one" may refer to one, two, or more.

[0060] It should also be understood that for any component, data, or structure mentioned in the embodiments of the present disclosure, unless specifically defined or given a contrary indication in the context, it can generally be understood as one or more.

[0061] In addition, the term "and / or" in this disclosure is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this disclosure generally represents an "or" relationship between the associated objects before and after.

[0062] It should also be understood that the description of each embodiment in this disclosure emphasizes the differences between the embodiments, and their similarities can be referred to each other. For the sake of brevity, they will not be elaborated one by one.

[0063] The following description of at least one exemplary embodiment is actually only illustrative and in no way restricts the present disclosure and its application or use.

[0064] Techniques, methods, and devices known to those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, the said techniques, methods, and devices should be regarded as part of the specification.

[0065] It should be noted that like reference numerals and letters indicate like items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further discussed in subsequent figures.

[0066] Embodiments of the present disclosure can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate together with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments, and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, servers, etc. include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, and so on.

[0067] Terminal devices, computer systems, servers and other electronic devices can be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. Generally, program modules can include routines, programs, target programs, components, logics, data structures, etc., which perform specific tasks or implement specific abstract data types. The computer system / server can be implemented in a distributed cloud computing environment, where tasks are executed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.

[0068] Figure 1The flowchart shows the error detection method for an application in some embodiments of the present disclosure. As Figure 1 shown, the error detection method for an application includes the following steps:

[0069] S1: Define an application view class for processing the application file set.

[0070] Since the error detection method for the application in the embodiments of the present disclosure can perform error detection with the help of a code obfuscation tool, an application view class (AppView) suitable for the code obfuscation tool and used to process the application file set is defined.

[0071] S2: Store the first application class set of the target application and the inheritance relationships between the application classes in the first application class set into the application view class.

[0072] Among them, the target application is configured with at least one plugin. When the target application runs, the plugins used by the target application also run. When the target application crashes, steps S2 - S4 are executed for error detection.

[0073] All application classes (such as DexProgramClass) that need to be error - detected in the target application can be extracted from the installation package of the target application to construct the first application class set (i.e., the DexProgramClass set corresponding to the target application). Among them, DexProgramClass is used to describe the class information in the Dex file. DexProgramClass includes the following parts:

[0074] Class definition data index (class_defs): Records various information of the specified class, including information such as interfaces, superclasses, and class data offsets.

[0075] Field data index (field_ids): Records information such as the class to which the field belongs, the type, and the field name.

[0076] Method data index (method_ids): Records information such as the class to which the method belongs, the method declaration, and the method name.

[0077] In addition, the inheritance relationships between the application classes in the first application class set can also be extracted from the installation package of the target application. Among them, all the parent classes and subclasses in the first application class set can be determined through the inheritance relationships between the application classes.

[0078] Store the first set of application classes and the inheritance relationships between the application classes in the first set of application classes into the application view class, so as to perform error detection on each application class in the first set of application classes through the application view class.

[0079] S3: Based on the application view class, perform member function prototype matching and line-by-line code verification in the member function bodies for each application class in the first set of application classes.

[0080] Perform member function prototype matching on each application class in the first set of application classes according to a preset member function prototype matching method to determine whether each application class in the first set of application classes matches the corresponding function prototype, and obtain a member function prototype matching result including whether the member function prototypes of each application class in the first set of application classes match.

[0081] Perform line-by-line code verification on the member function bodies of each application class in the first set of application classes according to a preset code verification method to verify whether each line of code in the member function bodies of each application class in the first set of application classes implements the corresponding function, so as to obtain a line-by-line code verification result including whether each line of code in the first set of application classes implements the corresponding function.

[0082] S4: Based on the member function prototype matching results and line-by-line code verification results of each application class, determine the error classes in the first set of application classes.

[0083] According to the member function prototype matching results and line-by-line code verification results of each application class, an application class with a mismatched member function prototype can be determined as an error class, and an application class with at least one line of code that cannot implement the corresponding function can also be determined as an error class.

[0084] In this embodiment, since the reasons for the application to crash due to errors usually include errors in the classes used in the application, the first set of application classes of the target application and the inheritance relationships between the application classes in the first set of application classes are stored in the application view class. Then, based on the application view class, member function prototype matching and line-by-line code verification in the member function bodies are performed on each application class in the first set of application classes. Based on the member function prototype matching results and line-by-line code verification results of each application class, the error classes in the first set of application classes that cause the target application to crash can be quickly and accurately detected.

[0085] In some embodiments of the present disclosure, when the operating system of the target application is the Android system, before step S2, it further includes: extracting a first set of application classes and the inheritance relationships between the application classes from the Dalvik bytecode in the installation package of the target application based on a preset code obfuscation tool and the framework of the Android system.

[0086] Among them, the preset code obfuscation tool may include R8. R8 is an obfuscation tool for the Android operating system. At the same time, it integrates the function of converting classes to Dex, concentrating the obfuscation and Dex functions into one tool, which significantly optimizes the obfuscation time consumption and package size.

[0087] Dalvik bytecode is the compilation output format of Java applications on the Android platform, which is converted into machine code by the Dalvik virtual machine at runtime.

[0088] Based on the AppView of the R8 DexApplication model, combined with the file of the Android operating system framework (android framework.jar) and the installation package of the target application (i.e., the Android application package (APK)), the Dex file in the APK can be read and converted into an AppView to extract all DexProgramClasses from it, and at the same time, the inheritance relationships between its parent classes and subclasses are parsed.

[0089] In this embodiment, for the Android system, with the help of a preset code obfuscation tool and the framework of the Android system, a first set of application classes and the inheritance relationships between the application classes can be extracted from the Dalvik bytecode in the installation package of the target application, so as to store the first set of application classes and the inheritance relationships between the application classes into the application view class for error detection.

[0090] Figure 2 It is a schematic flowchart of step S4 in some embodiments of the present disclosure. As Figure 2 shown, step S4 may include the following steps:

[0091] S4-1: Based on the inheritance relationships between the application classes in the application view class, perform member function prototype matching on the application view classes in the application view class.

[0092] For each application class in the first set of application classes, based on the inheritance relationship between each application class and other application classes, detect whether the parameter types, parameter numbers, and return values of each application class match those of its parent class and the calling interface. If the parameter type of a certain application class does not match that of its parent class or the calling interface, the parameter number does not match, or the return value does not match, it is determined that the member function prototype of the application class does not match.

[0093] S4-2: Determine the class with a mismatched member function prototype as an error class.

[0094] In an example of the present disclosure, if the parameter type of application class A in the first set of application classes is Object, and the parameter type of the parent class of application class A is Number, and Object is not Number or its subclass, it is determined that the member function prototype of application class A does not match, and application class A is determined as an error class.

[0095] In another example of the present disclosure, if the number of parameters of application class B in the first set of application classes is 3, and the number of parameters of the calling interface of application class B is 2, it is determined that the member function prototype of application class B does not match, and application class B is determined as an error class.

[0096] In another example of the present disclosure, if the return value type of application class C in the first set of application classes is of the Animal type, and the return value type of the subclass of application class C does not belong to the Animal type or its subclass, it is determined that the member function prototype of application class C does not match, and application class C is determined as an error class.

[0097] S4-3: Check the name, parameter type, and parameter number of each line of code function call in the member function body of each application view class in each application class.

[0098] For each application class in the first set of application classes, check the name, parameter type, and parameter number of each line of code function call in the member function body, which can check whether there are errors in the name, parameter type, and parameter number of each line of code function call in the member function body of each application class.

[0099] In an example of the present disclosure, if a certain line of code in a certain application class in the first set of application classes includes a call to the class (LJPluginUpdateManager.Companion), traverse its virtualMethod (virtual method) and check whether the member functions of the class itself match in combination with the function prototype. If they do not match, query in the upper-level parent class (or interface). If no match can be found, it is determined that there is an error in the function call relationship of the class including the call to this line of code.

[0100] S4-4: Determine the application classes with incorrect function call names, parameter types, or parameter counts in at least one line of code as error classes.

[0101] For each application class in the first set of application classes, if there is at least one line of code in the application class with an incorrect function call name, parameter type, or parameter count, then determine the application class as an error class.

[0102] In this embodiment, since the correct application classes in the first set of application classes should match the member function prototypes of the parent class and the call interface, and the names, parameter types, and parameter counts of the function calls in each line of code within the member function body are correct, therefore, by performing member function prototype matching on each application class in the first set of application classes with its parent class and the call interface, and verifying the names, parameter types, and parameter counts of the function calls in each line of code within the member function body of each application class, the error classes with errors in the first set of application classes can be quickly and accurately determined.

[0103] In some embodiments of the present disclosure, after step S4, the following steps may further be included:

[0104] S5: Prompt the error classes in the first set of application classes.

[0105] If the error type of a certain error class in the first set of application classes is a mismatch of the member function prototype, the error class can be prompted to the terminal of the staff, and the correct member function prototype of the error class can be prompted, which helps the staff to quickly locate the error class and adjust the member function prototype of the error class.

[0106] If the error type of a certain error class in the first set of application classes is a code line with an incorrect function call name, parameter type, or parameter count in the member function body, the error class can be prompted to the terminal of the staff, the line of code with the error in the error class can be prompted, and the correct function call name, parameter type, or parameter count of the line of code can be prompted, which helps the staff to quickly locate the error class and modify the function call name, parameter type, or parameter count of the error class.

[0107] In this embodiment, by prompting the error classes in the first set of application classes, it helps the staff to quickly locate the error classes and solve the errors.

[0108] Figure 3 It is a schematic diagram of a partial process of the error detection method for an application program in some embodiments of the present disclosure. As Figure 3As shown, the method for locating errors in an application may further include the following steps:

[0109] S6: Generate a compressed package including a first set of application classes based on the installation package of the target application.

[0110] The application package of the target application can be compressed to obtain a compressed package including a first set of application classes, that is, all Dex files in the target application are compressed into a jar package (host-library.jar) as the runtime dependency library for all plugins of the target application.

[0111] S7: Store the second set of application classes corresponding to the target plugin of the target application and the inheritance relationships between the application classes in the second set of application classes into the application view class.

[0112] Unzip multiple built-in plugins in the target application to a temporary directory. Then, each plugin of the target application can be used as the target plugin to extract all application classes corresponding to the target plugin and construct a second set of application classes, that is, all DexProgramClasses of the target plugin.

[0113] S8: Based on the application view class and the compressed package, perform member function prototype matching and line-by-line code verification in the member function bodies for each application class in the second set of application classes to determine the error classes in the second set of application classes.

[0114] Use a method similar to steps S3 and S4 to determine the error classes in the second set of application classes. When detecting error classes for the application classes in the second set of application classes compared to detecting error classes for the application classes in the first set of application classes, the compressed package (host-library.jar) is also required as the runtime dependency library for all plugins because some functions of the plugins rely on the first runnable classes of the target application.

[0115] Figure 4 It is the schematic diagram of extracting the plugin AppView in an application in an example of the present disclosure. As Figure 4As shown, obtain the first set of application classes (i.e., the DexProgramClass set of the target application) from the application package of the target application and the inheritance relationships between the application classes in the first set of application classes. Then, generate the AppView corresponding to the target application based on the first set of application classes and the inheritance relationships between the application classes in the first set of application classes. Compress the AppView of the target application to obtain a compressed package (host-library.jar). Obtain the second set of application classes (i.e., the DexProgramClass set of the target plug-in and the inheritance relationships between the application classes in the second set of application classes) from the target plug-in. Then, generate the AppView corresponding to the target plug-in based on the compressed package (host-library.jar), the second set of application classes, and the inheritance relationships between the application classes in the second set of application classes.

[0116] Figure 5 is the schematic diagram for detecting the AppView in an example of the present disclosure. As Figure 5 shown, for the AppView of the target application or the AppView of the target plug-in, obtain its corresponding DexProgramClass set (i.e., the first set of application classes or the second set of application classes or the second). Select an application class DexProgramClass from the DexProgramClass set, perform member function prototype matching on the currently selected application class DexProgramClass, and perform line-by-line code verification in the member function body of the currently selected application class DexProgramClass regardless of whether the member function prototype matching is successful. Among them, if the member function prototype matching of the currently selected application class DexProgramClass fails, determine that the currently selected application class DexProgramClass is an error class and record the member function prototype of the currently selected application class DexProgramClass. If an error occurs during the line-by-line code verification in the member function body of the currently selected application class DexProgramClass within the class function, determine that the currently selected application class DexProgramClass is an error class and record the code line where the error occurs.

[0117] In this embodiment, since the plug-in of the application lacks some runnable classes compared to the application, when detecting error classes for the target plug-in, by performing member function prototype matching and line-by-line code verification in the member function body on each application class in the second set of application classes of the target plug-in according to the compressed package including the first set of application classes, the error classes in the second set of application classes can be quickly and accurately determined.

[0118] Figure 6 This is a structural block diagram of an error detection device for an application program in an embodiment of the present disclosure. As Figure 6 shown, the error detection device for an application program includes:

[0119] A class definition module 100, configured to define an application view class for processing an application program file set;

[0120] A class information processing module 200, configured to store a first application program class set of a target application program and an inheritance relationship between application program classes in the first application program class set into the application view class, where the target application program is configured with at least one plugin;

[0121] A matching verification module 300, configured to perform member function prototype matching and line-by-line code verification in the member function body on each application program class in the first application program class set based on the application view class;

[0122] An error class determination module 400, configured to determine an error class in the first application program class set based on the member function prototype matching result and the line-by-line code verification result of each application program class.

[0123] In some embodiments of the present disclosure, the operating system of the target application program is the Android system;

[0124] The class information processing module 100 is further configured to extract the first application program class set and the inheritance relationship between application program classes from the Dalvik bytecode in the installation package of the target application program based on a preset code obfuscation tool and the framework of the Android system.

[0125] In some embodiments of the present disclosure, the matching verification module 300 is configured to:

[0126] Perform member function prototype matching on each application view class in the application view class based on the inheritance relationship between application program classes in the application view class;

[0127] Verify the name, parameter type, and number of parameters of each line of code function call in the member function body of each application view class in each application program class;

[0128] The error class determination module 400 is configured to determine a class with a mismatched member function prototype as an error class; the error class determination module is further configured to determine an application program class with at least one line of code having an incorrect function call name, parameter type, or number of parameters as an error class.

[0129] Figure 7 This is a structural block diagram of an error detection device for an application program in other embodiments of the present disclosure. As Figure 7As shown, the error detection device of the application further includes:

[0130] A prompt module 500, configured to prompt error classes in the first application class set.

[0131] In some embodiments of the present disclosure, the error location device for plug-in applications further includes:

[0132] A compression module 600, configured to generate a compressed package including the first application class set based on the installation package of the target application;

[0133] Wherein, the class information processing module 200 is further configured to store the second application class set corresponding to the target plug-in of the target application and the inheritance relationship between the application classes in the second application class set into the application view class; the matching verification module 300 is further configured to perform member function prototype matching and line-by-line code verification in the member function body on each application class in the second application class set based on the application view class and the compressed package; the error class determination module 400 is further configured to determine the error classes in the second application class set based on the member function prototype matching results and the line-by-line code verification results of each application class.

[0134] It should be noted that the specific implementation manner of the error detection device of the application in the embodiments of the present disclosure is similar to the specific implementation manner of the error detection method of the application in the embodiments of the present disclosure, and the technical effects of the error detection device of the application in the embodiments of the present disclosure are similar to the technical effects of the error detection method of the application in the embodiments of the present disclosure. For details, please refer to the description in the part of the error detection method of the application. To reduce redundancy, it will not be elaborated here.

[0135] In addition, the embodiments of the present disclosure further provide an electronic device, including:

[0136] A memory, configured to store a computer program;

[0137] A processor, configured to execute the computer program stored in the memory, and when the computer program is executed, implement the error detection method of the application according to any one of the above embodiments of the present disclosure.

[0138] Next, refer to Figure 8 to describe the electronic device according to the embodiments of the present disclosure. As Figure 8 shown, the electronic device includes one or more processors and a memory.

[0139] The processor may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.

[0140] The memory can store one or more computer program products. The memory can include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory can include, for example, random access memory (RAM) and / or cache memory, etc. The non-volatile memory can include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program products can be stored on the computer-readable storage media, and the processor can run the computer program products to implement the error detection method of the application programs of the various embodiments of the present disclosure described above and / or other desired functions.

[0141] In one example, the electronic device can further include: an input device and an output device, and these components are interconnected through a bus system and / or other forms of connection mechanisms (not shown).

[0142] In addition, the input device can further include, for example, a keyboard, a mouse, and so on.

[0143] The output device can output various information to the outside, including the determined distance information, direction information, etc. The output device can include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, and so on.

[0144] Of course, for simplicity, Figure 8 only some of the components related to the present disclosure in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application scenarios, the electronic device can further include any other appropriate components.

[0145] In addition to the above methods and devices, the embodiments of the present disclosure can also be a computer program product, which includes computer program instructions, and when the computer program instructions are run by the processor, the processor is caused to execute the steps in the error detection method of the application programs according to the various embodiments of the present disclosure described in the above part of this specification.

[0146] The computer program product can be written in any combination of one or more programming languages for programming code to perform the operations of the embodiments of the present disclosure. The programming languages include object-oriented programming languages, such as Java, C++, etc., and also include conventional procedural programming languages, such as the "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, executed as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0147] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium storing computer program instructions, which, when run by a processor, cause the processor to execute the steps in the error detection method of the application program according to various embodiments of the present disclosure described in the above part of this specification.

[0148] The computer-readable storage medium may adopt any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may, for example, include but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0149] The basic principles of the present disclosure have been described above in conjunction with specific embodiments. However, it should be noted that the advantages, benefits, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, benefits, effects, etc. are essential for each embodiment of the present disclosure. In addition, the above-described specific details are only for illustrative purposes and for easy understanding, rather than limitations. The above details do not limit the present disclosure to necessarily adopt the above specific details for implementation.

[0150] Each embodiment in this specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other. For system embodiments, since they basically correspond to method embodiments, the description is relatively simple, and reference can be made to the corresponding part of the method embodiments for relevant content.

[0151] The block diagrams of the devices, apparatuses, equipment, and systems involved in the present disclosure are only illustrative examples and do not intend to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open-ended terms, meaning "including but not limited to", and can be used interchangeably with each other. The words "or" and "and" used herein refer to the word "and / or" and can be used interchangeably with each other, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to" and can be used interchangeably with each other.

[0152] The methods and apparatuses of the present disclosure may be implemented in many ways. For example, the methods and apparatuses of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the methods is for illustration only. The steps of the methods of the present disclosure are not limited to the specific order described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, and these programs include machine-readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers a recording medium storing a program for executing the methods according to the present disclosure.

[0153] It should also be noted that in the apparatuses, devices, and methods of the present disclosure, each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent solutions of the present disclosure.

[0154] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0155] The above description has been presented for purposes of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the form disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and subcombinations thereof.

Claims

1. A method for detecting an error in an application, characterized in that: include: Define the application view class that handles the application file collection; storing a first application class set of a target application and an inheritance relationship between each application class in the first application class set in the application view class, wherein the target application is configured with at least one plug-in; Based on the application view class, performing member function prototype matching and line-by-line verification of codes in member function bodies on each application class in the first application class set; Based on the member function prototype matching results of each application class and the line-by-line verification results of the codes in the member function body, the error class in the first application class set is determined.

2. The method according to claim 1, characterized in that The operating system of the target application is Android system; Before storing the inheritance relationship between the first application class set of the target application and each application class in the first application class set in the application view class, the method includes: Based on a preset code obfuscation tool and an Android system framework, the first application class set and the inheritance relationship between the application classes are extracted from the Dalvik bytecode in the installation package of the target application.

3. The method according to claim 1, characterized in that The performing member function prototype matching and line-by-line verification of codes in member function bodies on each application class in the first application class set based on the application view class includes: Based on the inheritance relationship between the application program classes in the application view class, performing member function prototype matching on each application view class in the application view class; Determine the class whose member function prototype does not match as the error class; Verifying the name, parameter type and parameter quantity of each line of code function call in the member function body of each application view class in each application class; An application class in which a function call having at least one line of code has an incorrect name, an incorrect parameter type, or an incorrect number of parameters is called is determined as the error class.

4. The method according to any one of claims 1 to 3, characterized in that: Also includes: Prompt the error class in the first application class set.

5. The method according to claim 2, characterized in that: Also includes: Based on the installation package of the target application, generating a compressed package including the first application class set; storing a second application class set corresponding to the target plug-in of the target application and an inheritance relationship between application classes in the second application class set in the application view class; Based on the application view class and the compressed package, member function prototype matching and line-by-line verification of codes in member function bodies are performed on each application class in the second application class set to determine error classes in the second application class set.

6. An application error detection device, characterized in that: include: A class definition module, used to define application view classes that process a collection of application files; a class information processing module, configured to store a first application class set of a target application and an inheritance relationship between each application class in the first application class set into the application view class, wherein the target application is configured with at least one plug-in; A matching verification module, used for performing member function prototype matching and line-by-line verification of codes in member function bodies on each application class in the first application class set based on the application view class; The error class determination module is used to determine the error class in the first application class set based on the member function prototype matching results of each application class and the line-by-line verification results of the code in the member function body.

7. The device according to claim 6, characterized in that The operating system of the target application is Android system; The class information processing module is also used to extract the first application class set and the inheritance relationship between the application classes from the Dalvik bytecode in the installation package of the target application based on a preset code obfuscation tool and the framework of the Android system.

8. The device according to claim 6, characterized in that The matching verification module is used to: Based on the inheritance relationship between the application program classes in the application view class, performing member function prototype matching on each application view class in the application view class; Verifying the name, parameter type and parameter quantity of each line of code function call in the member function body of each application view class in each application class; Among them, the error class determination module is used to determine the class whose member function prototype does not match as the error class; the error class determination module is also used to determine the application class with a function call with an incorrect name, incorrect parameter type or incorrect parameter number in at least one line of code as the error class.

9. The device according to any one of claims 6 to 8, characterized in that: Also includes: A prompt module is used to prompt the error class in the first application class set.

10. The device according to claim 7, characterized in that Also includes: A compression module, used to generate a compressed package including the first application class set based on the installation package of the target application; Among them, the class information processing module is also used to store the inheritance relationship between the second application class set corresponding to the target plug-in of the target application and each application class in the second application class set into the application view class; the matching verification module is also used to perform member function prototype matching and line-by-line verification of the code in the member function body for each application class in the second application class set based on the application view class and the compressed package; the error class determination module is also used to determine the error class in the second application class set based on the member function prototype matching results of each application class and the line-by-line verification results of the code in the member function body.

11. An electronic device, characterized in that: include: a memory for storing a computer program product; A processor is used to execute the computer program product stored in the memory, and when the computer program product is executed, it implements the method described in any one of claims 1 to 5.

12. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method described in any one of claims 1 to 5 is implemented.

13. A computer program product, characterized in that The method comprises computer program instructions, which, when executed by a processor, enable the processor to execute the method according to any one of claims 1 to 5.