Component identification method, device, equipment, storage medium and program product
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BILIN STAR TECH (SHENZHEN) CO LTD
- Filing Date
- 2024-11-22
- Publication Date
- 2026-05-22
AI Technical Summary
In the rapidly evolving field of mobile application development, effectively managing and identifying component and version information has become a challenge for developers and testers. Existing technologies rely on manual recording, resulting in low identification efficiency and a high risk of errors, making them unsuitable for rapidly iterating development environments.
By obtaining the characteristic values of the application's dynamic link library files and matching them with a pre-stored characteristic library, the system automatically identifies component information. This includes techniques such as building a characteristic library, parsing the installation package, calculating hash values, and matching symbol tables with regular expressions, thus achieving automated component identification.
It improves the accuracy and efficiency of component identification, adapts to rapidly iterating development environments, and avoids reliance on manual recording and identification difficulties.
Smart Images

Figure CN122072689A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a component identification method, apparatus, device, storage medium, and program product. Background Technology
[0002] In today's rapidly evolving mobile application development landscape, component-based development has become a crucial method for improving development efficiency and code reuse. However, with the increasing number of components, effectively managing and identifying these components and their version information has become a major challenge for developers and testers.
[0003] In related technologies, developers primarily rely on manually acquiring and recording component information when integrating components. However, as applications become more complex, manually recording component information becomes tedious and error-prone. Developers may forget specific component information due to the passage of time or personnel changes, resulting in incomplete component information records and an inability to fully assess the risks of introduced components.
[0004] However, the above methods cannot adapt to rapidly iterating development environments, and the efficiency and accuracy of component identification are low. Summary of the Invention
[0005] This application provides a component identification method, apparatus, device, storage medium, and program product, which can improve component identification efficiency. The technical solution is as follows.
[0006] On the one hand, a component identification method is provided, the method comprising:
[0007] Obtain the installation package of the application, the installation package including at least one dynamic link library file, the dynamic link library file being used to configure the components used in the application, wherein the dynamic link library file has a corresponding relationship with the components used by the application;
[0008] Obtain the feature value corresponding to the dynamic link library file, the feature value being used to identify the dynamic link library file or the component corresponding to the dynamic link library file;
[0009] Component information that is associated with the feature value is obtained from the feature library. The component information is used to indicate the components used by the application. The feature library includes pre-stored associations between feature values and the component information.
[0010] On the other hand, a component identification device is provided, the device comprising:
[0011] An acquisition module is used to acquire the installation package of an application, wherein the installation package includes at least one dynamic link library file, the dynamic link library file is used to configure the components used in the application, and there is a correspondence between the dynamic link library file and the components used by the application;
[0012] The processing module is used to obtain the feature value corresponding to the dynamic link library file, and the feature value is used to identify the dynamic link library file or the component corresponding to the dynamic link library file;
[0013] The processing module is further configured to obtain component information that has a relationship with the feature value from the feature library. The component information is used to indicate the components used by the application. The feature library includes pre-stored relationships between feature values and the component information.
[0014] In some embodiments, the processing module is further configured to:
[0015] Obtain the component information corresponding to at least two candidate components and the candidate feature values corresponding to the candidate components;
[0016] The component information corresponding to the at least two candidate components, as well as the candidate feature values, are associated and stored in the feature library.
[0017] In some embodiments, the processing module is further configured to:
[0018] By traversing the official websites of the component channels through the information collection program, the component information corresponding to the at least two candidate components and the software development kit (SDK) corresponding to the at least two candidate components are obtained respectively.
[0019] Parse the SDK to obtain the dynamic link library files corresponding to the at least two candidate components;
[0020] The hash value corresponding to the dynamic link library file is calculated as the candidate feature value corresponding to the candidate component.
[0021] In some embodiments, the processing module is further configured to:
[0022] In cases where the correspondence indicates a one-to-one correspondence between the component and the dynamic link library file, or where one component corresponds to at least two dynamic link library files, a different feature value is generated for each dynamic link library file, and the feature value is used to uniquely identify the dynamic link library file;
[0023] When the correspondence indicates that at least two components share a dynamic link library file, at least two feature values are generated for the at least two components based on the same dynamic link library file. The feature values are used to uniquely identify the components, wherein the i-th component corresponds to the generation of the i-th feature value, and i is a positive integer.
[0024] In some embodiments, the processing module is further configured to:
[0025] Extract the symbol table from the dynamic link library, wherein the symbol table includes at least one symbol content among function names, variable names, class names, and component names configured in the dynamic link library file;
[0026] Obtain a preset expression, which is a regular expression generated based on component information pre-stored in the feature library;
[0027] Based on the preset expression, the symbol table is matched using regular expressions to obtain at least two symbol contents that match the preset expression;
[0028] Generate at least two feature values corresponding to the dynamic link library file for the at least two symbol contents.
[0029] In some embodiments, the processing module is further configured to:
[0030] Parse the installation package to obtain at least one dynamic link library file;
[0031] The hash value of the dynamic link library file is calculated to obtain the feature value.
[0032] In some embodiments, the processing module is further configured to:
[0033] Decompress the installation package to obtain a decompressed installation package file, which includes a binary file;
[0034] By decoding the installation package file, the binary file can be restored to obtain the plaintext file;
[0035] The at least one dynamic link library file is read from the plaintext file by a preset program, which is a pre-developed program for reading specified content.
[0036] In some embodiments, the processing module is further configured to:
[0037] Identify the system type of the operating system corresponding to the installation package;
[0038] If the operating system belongs to the first system type, the installation package is decompiled to obtain a decompilation result. The decompilation result includes at least one of the dynamic link library file and the first source code file. The first source code file corresponds to a file package name, which is used to uniquely identify the component referenced in the first source code file.
[0039] If the decompiled result includes the first source code file, component information that matches the file package name is obtained from the package name library. The package name library includes pre-stored associations between file package names and component information.
[0040] In some embodiments, the processing module is further configured to:
[0041] If the operating system is of the second system type, the installation package is decompressed to obtain a first executable file, which is expressed in binary form.
[0042] The first executable file is decompiled to obtain a second executable file, which is expressed in text form;
[0043] Obtain the regular expressions corresponding to at least two candidate feature values in the feature library;
[0044] The second executable file is subjected to regular expression matching based on the regular expression. If there is a file content in the second executable file that matches the regular expression, the component information is obtained from the feature library based on the candidate feature value corresponding to the regular expression.
[0045] In some embodiments, the acquisition module is further configured to periodically and automatically acquire at least two installation packages corresponding to at least two applications belonging to a preset application type;
[0046] The processing module is also used to identify component information corresponding to the at least two applications based on the at least two installation packages;
[0047] The processing module is further configured to count the number of programs using the first component in the at least two applications based on the component information, and determine the risk score of the first component based on the number of programs, wherein the risk score is positively correlated with the number of programs.
[0048] In some embodiments, the processing module is further configured to display component recommendation information when the component information meets the recommendation requirements. The component recommendation information includes a second component recommended to replace the first component, wherein the first component is a component currently used by the application.
[0049] The recommended requirements include at least one of the following:
[0050] The second component and the first component belong to the same component type, and the component version of the second component was released later than that of the first component; or,
[0051] The first component and the second component have the same component function type, and the number of applications using the second component in at least two applications belonging to the same application type is greater than the number of applications using the first component; or,
[0052] The first component is a component used in the first application, and the second component is a component used in the second application. The first component and the second component have the same component function type. The program rating of the second application is higher than that of the first application. The program rating of the first application is calculated based on the number of users, user activity, user usage time, and user ratings.
[0053] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by the processor to implement the component identification method as described in any of the embodiments of this application above.
[0054] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, code set, or instruction set is stored therein, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the component identification method as described in any of the embodiments of this application above.
[0055] On the other hand, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the component identification methods described in the above embodiments.
[0056] The beneficial effects of the technical solutions provided in this application include at least the following:
[0057] By using the feature values corresponding to dynamic link libraries as the feature values corresponding to components, and matching these feature values with candidate feature values in the feature library, component identification and corresponding component information can be obtained. This enables automated component identification, avoids reliance on manual component identification, adapts to rapid iterations in the development environment, and prevents difficulties in identifying components that have changed in the application due to a lack of manual records, thus improving the accuracy and efficiency of component identification. Attached Figure Description
[0058] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0059] Figure 1 This is a schematic diagram of a component identification system provided in an exemplary embodiment of this application;
[0060] Figure 2 This is a flowchart of a component identification method provided in an exemplary embodiment of this application;
[0061] Figure 3 This is a schematic diagram of a component identification process provided in an exemplary embodiment of this application;
[0062] Figure 4 This is a flowchart of a component identification method based on system type provided in an exemplary embodiment of this application;
[0063] Figure 5 This is a flowchart of a feature library construction method provided in an exemplary embodiment of this application;
[0064] Figure 6 This is a flowchart of a component identification and statistical method provided in an exemplary embodiment of this application;
[0065] Figure 7 This is a structural block diagram of a component identification device provided in an exemplary embodiment of this application;
[0066] Figure 8 This is a structural block diagram of a terminal provided in an exemplary embodiment of this application. Detailed Implementation
[0067] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0068] It should be understood that although the terms first, second, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, a first parameter may also be referred to as a second parameter without departing from the scope of this disclosure, and similarly, a second parameter may also be referred to as a first parameter. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0069] In today's rapidly evolving mobile application development landscape, component-based development has become a crucial means of improving development efficiency and code reuse. However, with the increasing number of components, effectively managing and identifying these components and their version information has become a significant challenge for developers and testers. Current technologies primarily rely on developers manually acquiring and recording component information when integrating them. However, as applications become more complex, manually recording component information becomes tedious and error-prone. Developers may forget specific component information due to the passage of time or personnel changes, resulting in incomplete component information records and an inability to fully assess the risks of introduced components. Furthermore, the aforementioned methods are ill-suited to the rapidly iterating development environment, exhibiting low component identification efficiency and accuracy.
[0070] The component identification method provided in this application embodiment uses the feature value corresponding to the dynamic link library as the feature value corresponding to the component, and matches the feature value with the candidate feature value in the feature library to realize component identification and obtain the corresponding component information. It can realize automated component identification, avoid dependence on manual component identification, adapt to the rapid iteration of the development environment, and avoid the difficulty in identification due to lack of manual records when the components used in the application change, thus improving the accuracy and efficiency of component identification.
[0071] First, the component identification system of this application will be introduced. Please refer to... Figure 1 The diagram illustrates a component identification system provided in an exemplary embodiment of this application, which includes a terminal 110.
[0072] Terminal 110 is used to provide a component identification platform for identifying components used in an application.
[0073] To illustrate, a user can upload an application's installation package by logging into a component identification platform. The installation package includes at least one dynamic link library (DLL) file, which is used to locate components used in the application. There is a correspondence between the DLL file and the components used in the application. The component identification platform obtains the feature value corresponding to the DLL file. This feature value uniquely identifies the correspondence between the DLL file and the component; that is, the feature value identifies the DLL file or the component corresponding to it. The platform then retrieves component information associated with the feature value from a feature library. This component information indicates the components used by the application. The feature library includes pre-stored associations between feature values and component information.
[0074] In some embodiments, the component identification system further includes a server 120.
[0075] Optionally, server 120 is a backend server of the component recognition platform, used to provide backend services for the component recognition platform, including but not limited to performing component recognition in the cloud, or providing services such as feature library, etc., which are not limited in this embodiment of the application.
[0076] As an illustration, terminal 110 is logged into a component identification platform, and server 120 stores a feature library. After terminal 110 obtains the installation package of the application uploaded by the user, it obtains the feature value of the dynamic link library file corresponding to the installation package and sends the feature value to server 120. Server 120 then obtains the component information that is related to the feature value from the feature library and returns the component information to terminal 110, which then displays or broadcasts the component information.
[0077] In some embodiments, the server 120 in the component identification system includes server 121 and server 122, and the component identification system also includes a database 130 corresponding to server 120.
[0078] Server 121 is the web server for the component recognition platform, used to provide web services for the platform; server 122 is the script server for the platform, used to run component recognition scripts and implement component recognition functionality. Database 130 includes a pre-stored feature library.
[0079] In a schematic manner, terminal 110 accesses the component identification platform, and server 121 provides web page services. For example, after terminal 110 uploads an installation package to server 121, server 121 forwards the installation package to server 122 for component identification. Server 122 obtains the feature value of the dynamic link library file corresponding to the installation package, retrieves component information that is related to the feature value from the feature library, and returns the component information to server 121. Server 121 then returns the component information to terminal 110 for display according to the web page service requirements of the component identification platform.
[0080] It is worth noting that the above-described interaction methods are merely illustrative examples, and the embodiments of this application do not limit them.
[0081] The aforementioned terminal is optional and can be a desktop computer, laptop computer, mobile phone, tablet computer, extended reality (XR) device e-book reader, Moving Picture Experts Group Audio Layer III (MP3) player, Moving Picture Experts Group Audio Layer IV (MP4) player, smart TV, smart vehicle, and other terminal devices. This application embodiment does not limit the specific terminal device in this regard.
[0082] It is worth noting that the aforementioned servers can be independent physical servers, server clusters or distributed systems consisting of at least two physical servers, or cloud servers that provide basic cloud computing services such as cloud services, cloud security, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0083] Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or local area network to achieve data computing, storage, processing, and sharing.
[0084] In some embodiments, the server described above can also be implemented as a node in a blockchain system.
[0085] It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant regions. For example, the operational data and account information involved in this application were obtained with full authorization.
[0086] To further explain, this application can display prompt interfaces, pop-ups, or output voice prompts before and during the collection of user-related data (e.g., installation package and component information involved in this application). These prompt interfaces, pop-ups, or voice prompts are used to inform the user that their relevant data is being collected. This ensures that the application only begins the steps for collecting user-related data after receiving confirmation from the user regarding the prompt interface or pop-up; otherwise (i.e., without receiving confirmation from the user), the steps for collecting user-related data end, meaning no user-related data is collected. In other words, all user data collected in this application is collected with the user's consent and authorization, and the collection, use, and processing of related user data must comply with the relevant laws, regulations, and standards of the relevant regions.
[0087] This is illustrative; please refer to it. Figure 2 This document illustrates a flowchart of a component identification method provided in an exemplary embodiment of this application. This method can be executed by a terminal, a server, or both simultaneously. This embodiment uses the execution of the method by a terminal as an example for illustration. Figure 2 As shown, the method includes the following steps:
[0088] Step 210: Obtain the application installation package.
[0089] The installation package includes at least one dynamic link library file, which is used to configure the components used in the application. There is a correspondence between the dynamic link library file and the components used by the application.
[0090] The application includes any program whose components are to be identified. The application can be an application that is already installed on the terminal, an application that is not installed on the terminal, or an application that cannot be installed on the terminal. This application does not limit this.
[0091] In some embodiments, the terminal is equipped with a component identification program that provides component identification functionality.
[0092] The installation package obtained by the terminal may be uploaded by the user based on the component identification program, or it may be sent by other terminals or servers, or it may be automatically obtained by the component identification program for locally installed applications. This application embodiment does not limit this.
[0093] Taking the installation package being sent by other terminals or servers as an example, the component identification program can automatically identify externally sent installation packages. For instance, when a user receives an installation package sent by another user through social media, or when a user triggers the download of an installation package provided on the network, the component identification program can automatically obtain the installation package and participate in component identification.
[0094] Taking the component identification program as an example of automatically obtaining the installation package of locally installed applications, the component identification program can automatically obtain the installation package of the installed applications within a preset time period when the terminal installs or updates the applications to participate in component identification, or it can periodically obtain the installation package of locally installed applications to participate in component identification at preset time intervals, etc.
[0095] It is worth noting that the above-described methods for obtaining the installation package are merely illustrative examples, and the embodiments of this application do not limit them.
[0096] In some embodiments, the application has different installation packages for different operating systems.
[0097] For example, for Android systems, this involves obtaining the Android installation package (APK) of an application, and for iOS systems, it involves obtaining the iOS application archive (IPA) of an application.
[0098] Dynamic link library files are used to provide resources such as code, data, or functions for applications.
[0099] Different operating systems may have different forms of dynamic link library files.
[0100] To illustrate, dynamic link library files for the Windows operating system include DLL (Dynamic Link Library) files, dynamic link library files for the Android system include .so files, and dynamic link library files for the iOS system include .dylib files.
[0101] It is worth noting that the types of the installation packages and dynamic link library files mentioned above are merely illustrative examples, and the embodiments of this application do not limit them.
[0102] There is a correspondence between dynamic link libraries and components. Optionally, the correspondence may be one-to-one, one-to-many, or many-to-one. This application does not limit this in its embodiments.
[0103] Taking a one-to-one correspondence as an example, each component used in the application corresponds to a unique dynamic link library file, which contains the implementation code and resources of that component.
[0104] Taking a one-to-many relationship as an example, a component may contain at least two dynamic link library files, which are used to provide different functions or versions of the component.
[0105] Taking a many-to-one relationship as an example, at least two components may share a dynamic link library file, and at least two files may share parts of the library or code within the dynamic link library. For example, at least two components may use the same common encryption library or data processing library.
[0106] Step 220: Obtain the feature value corresponding to the dynamic link library file.
[0107] The feature value is used to identify a dynamic link library file or a component corresponding to a dynamic link library file.
[0108] In some embodiments, the feature value is used to uniquely indicate the correspondence between dynamic link library files and components.
[0109] When obtaining the characteristic values corresponding to dynamic link library files, it is necessary to obtain the characteristic values corresponding to dynamic link library files for each component based on the correspondence between components and dynamic link libraries.
[0110] When a component corresponds to at least one dynamic link library file, different feature values can be generated for each dynamic link library file based on different dynamic link library files; when at least two components share a dynamic link library file, different feature values need to be generated for the same dynamic link library file in combination with different components.
[0111] Optionally, the process of obtaining feature values based on the correspondence includes at least the following two cases:
[0112] The first approach involves generating a unique feature value for each dynamic link library file when the correspondence indicates a one-to-one correspondence between the component and the dynamic link library file, or when one component corresponds to at least two dynamic link library files. This feature value is used to uniquely identify the dynamic link library file.
[0113] Specifically, when a component corresponds one-to-one with a dynamic link library file, this feature value is used to uniquely identify the component; when a component corresponds to at least two dynamic link library files, this feature value is used to uniquely identify the same component with different versions or functions.
[0114] As an illustration, a hash value is generated for each dynamic link library file as a feature value. This hash value is used to uniquely identify the dynamic link library file, so that when a component corresponds to at least one dynamic link library file, different components, or different versions or functions of the same component can be uniquely identified by the hash value.
[0115] The second approach involves generating at least two feature values for at least two components based on the same dynamic link library file, where the correspondence indicates that at least two components share a dynamic link library file. These feature values are used to uniquely identify the components. The i-th component generates the i-th feature value, where i is a positive integer.
[0116] When the correspondence indicates that at least two components share a dynamic link library file, different feature values can be generated for different components when the component corresponding to the dynamic link library file is unknown, by analyzing the file content of the dynamic link library file.
[0117] In some embodiments, the feature value generation process includes: extracting a symbol table from a dynamic link library file, the symbol table including at least one symbol content among function names, variable names, class names, and component names configured in the dynamic link library file; obtaining a preset expression, the preset expression being a regular expression generated based on component information pre-stored in a feature library; performing regular matching on the symbol table based on the preset expression to obtain at least two symbol contents that match the preset expression; and generating at least two feature values corresponding to the dynamic link library file for the at least two symbol contents.
[0118] As an illustration, the symbol table in a dynamic link library can be obtained using the symbol list (nm) tool.
[0119] Optionally, a regular expression can be generated based on a string corresponding to at least one of the following contents in the component information: component name, component version number, component release time, component source, component privacy permission information, etc., and used as the preset expression for the component.
[0120] When performing regular expression matching on the symbol table, the preset expression corresponding to each component in the feature library is matched with the symbol table, and each component corresponds to at least one preset expression.
[0121] In some embodiments, since it may be difficult to know the correspondence between components and dynamic link library files when the components used in the unknown application are involved, a preset expression can be used for regular expression matching for each dynamic link library file corresponding to the installation package to determine the correspondence.
[0122] Specifically, when there is one and only one preset expression in the feature library that matches the first dynamic link library file, it is determined that the first dynamic link library file belongs to at least one dynamic link library file corresponding to the first component, and the feature value of the first dynamic link library file can be directly generated to participate in feature value matching; when there are at least two preset expressions in the feature library that match the first dynamic link library file, it is determined that the first dynamic link library file corresponds to at least two components, and at least two feature values are generated based on the at least two preset expressions that match the first dynamic link library file to participate in feature value matching.
[0123] The method provided in this application, by employing different feature value generation methods based on the correspondence between components and dynamic link library files, ensures that feature values can be used to uniquely identify components used in the application, thereby... improve Component recognition efficiency In cases where a component corresponds to at least one dynamic link library (DLL) file, directly generating the feature value corresponding to the DLL file is sufficient to uniquely identify the component, reducing the computational load in component identification and improving its efficiency. When a DLL file corresponds to at least two components, feature values can be generated by combining component features with those of the DLL file, ensuring that the feature values still uniquely identify the component and preventing omissions during component identification. Improved components Accuracy of recognition .
[0124] The method provided in this application generates at least two feature values corresponding to a dynamic link library file by matching symbol content with a preset expression corresponding to the component in the dynamic link library file. This provides an implementation method for generating feature values by combining component features with the dynamic link library file, simplifying the method of extracting component features from the dynamic link library file. Improved component recognition efficiency .
[0125] In some embodiments, a feature value can be obtained by calculating a hash value. This process includes parsing the installation package to obtain at least one dynamic link library file; calculating a hash value for the dynamic link library file to obtain the feature value.
[0126] As an illustration, the hash value of a dynamic link library file can be calculated according to a preset algorithm. The preset algorithm used in the component identification process is consistent with the algorithm used when building the feature library to ensure that the hash value calculated for the same dynamic link library file remains unique and consistent.
[0127] Optionally, the preset algorithm includes, but is not limited to, any hash algorithm such as MD5, SHA-1, SHA-256, etc., and the embodiments of this application do not limit it.
[0128] The method provided in this application calculates a hash value for a dynamic link library file to obtain a feature value. Based on the characteristics of hash values, the feature value generated for the same dynamic link library file under the same conditions can be unique, thereby accurately and uniquely identifying the correspondence between components and dynamic link library files. Improve the accuracy of component identification and efficiency .
[0129] Optionally, the process of parsing the installation package to obtain dynamic link library files includes: decompressing the installation package to obtain a decompressed installation package file, which includes a binary file; decoding the installation package file to restore the binary file to a plaintext file; and reading at least one dynamic link library file from the plaintext file using a preset program.
[0130] An installation package is essentially a compressed file that includes code, resources, configuration files, etc. It can be decompressed using decompression programs or other methods. For example, using Python's zip module, code can be used to find subfiles within the compressed package, read the necessary files, and store them locally.
[0131] The files extracted from the installation package are usually compiled binary files, which are not plaintext readable. It is necessary to restore the binary files to obtain plaintext files.
[0132] Alternatively, the installation package file can be decoded using a pre-trained encoding / decoding model, which is a pre-trained machine learning model used to restore the binary file to a plaintext file.
[0133] Indicatively, the training process of this codec model includes: obtaining a sample file, which is a binary file compiled from a reference file, the reference file being a compilable plaintext file; reconstructing the sample file using a candidate codec model to obtain a prediction file; training the candidate codec model based on the difference between the prediction file and the reference file until it meets the training requirements, thus obtaining the aforementioned codec model.
[0134] It is worth noting that the above-mentioned file restoration methods and model training methods are merely illustrative examples, and the embodiments of this application do not limit them.
[0135] When reading dynamic link library files from plaintext files, you can read dynamic link library files based on preset file extensions, which are used to indicate dynamic link library files.
[0136] A default program is a pre-developed program used to read specified content.
[0137] To illustrate, using .so files as an example, at least one .so file can be read by recognizing the ".so" file extension.
[0138] The method provided in this application decompresses the installation package, decodes the installation package file, restores the binary file to obtain the plaintext file, and reads the dynamic link library file. It provides a parsing method for the installation package. While obtaining the dynamic link library file to participate in component identification, it can also obtain other component-related information by parsing the installation package, which is beneficial for the identification of candidate components.
[0139] Step 230: Obtain component information that is related to the feature values from the feature library.
[0140] Component information is used to indicate the components used by the application, and the feature library includes pre-stored associations between feature values and component information.
[0141] Optionally, component information includes, but is not limited to, component name, component version information, component release time, component source, component dependencies, component privacy permissions, and any other component-related information that can be collected under sufficient authorization.
[0142] A feature library is a pre-built database used to store the association between component information and feature values.
[0143] In some embodiments, the process of constructing the feature library includes obtaining component information and candidate feature values corresponding to at least two candidate components; and storing the component information and candidate feature values corresponding to at least two candidate components in the feature library.
[0144] The data acquisition process for building the feature library includes: traversing the official websites of component channels through an information collection program to obtain component information corresponding to at least two candidate components, and software development kits (SDKs) corresponding to at least two candidate components; parsing the SDKs to obtain dynamic link library files corresponding to at least two candidate components; and calculating the hash value corresponding to the dynamic link library file as the candidate feature value corresponding to the candidate component.
[0145] The information collection program is a pre-developed program used to traverse the official websites of component channels and obtain component information.
[0146] As an example, for the installation package corresponding to the Android system, the .so file and .java file can be obtained by parsing the SDK.
[0147] In some embodiments, the feature library may also include the package name of the Java file package corresponding to the component.
[0148] To illustrate, after obtaining the component information corresponding to at least two candidate components and the SDK corresponding to at least two candidate components, the SDK is parsed to obtain the Java files corresponding to at least two candidate components; the file package name corresponding to the Java file is obtained, and the component information is associated with the file package name and written into the feature library.
[0149] The feature library includes the correspondence between component information, feature values, and file package names.
[0150] Optionally, the combination of the feature value and the file package name is used to uniquely identify component information.
[0151] Taking component information, including component name and component version, as an example, please refer to Table 1 below for the structure of the feature library:
[0152] Component name Component version Eigenvalues File package name Component Name 1 Version v1.0 Hash value of dynamic link library file Java source code file package name Component Name 1 Version v1.1 Hash value of dynamic link library file Java source code file package name Component Name 1 Version v1.2 Hash value of dynamic link library file Java source code file package name Component Name 2 Version v1.0 Hash value of dynamic link library file Java source code file package name Component Name 2 Version v1.1 Hash value of dynamic link library file Java source code file package name Component Name 2 Version v1.2 Hash value of dynamic link library file Java source code file package name
[0153] Table 1 Feature Library Structure
[0154] Indicatively, after obtaining the feature value and file package name, the associated component name and component version are read from the feature library based on at least one of the feature value and component package name.
[0155] Optionally, the feature library includes any one of the following associations: component information and feature value, component information and file package name, or component information and feature value and file package name.
[0156] This is illustrative; please refer to it. Figure 3 , Figure 3 This is a schematic diagram of a component identification process provided in an exemplary embodiment of this application, such as... Figure 3 As shown, the component identification process is performed by the web front-end, database, and back-end server.
[0157] In this process, the web frontend executes step 311 to upload the application (App) installation package; the backend server executes step 331 to receive the file; step 332 returns the uploading status; the web frontend executes step 312 to display "Uploading in progress"; the backend server executes step 333 to display "Received complete"; and the web frontend executes step 313 to display "Detecting in progress".
[0158] The backend server executes step 334 to begin parsing the installation package; step 335 to obtain files within the installation package, including .so and .dex files; step 336 to crack encrypted files; step 337 to obtain component feature values; step 338 to match them with the feature library; step 339 to obtain component information; step 340 to generate a detection report; step 341 to send an email; and step 342 to return the page results.
[0159] After the web frontend executes step 342 on the backend server, it executes step 314 to view the test report.
[0160] Specifically, the database executes step 321 based on step 335 to write basic information into the database; executes step 322 based on step 336 to write detailed information into the database; executes step 323 based on step 337 to write component feature values into the database; executes step 324 based on step 339 to write component information into the database; and executes step 325 based on step 340 to write the test report into the database.
[0161] In some embodiments, when a component not found in the feature library is identified based on the installation package, the component information and feature value corresponding to that component can be associated and written into the feature library to achieve dynamic updates to the feature library.
[0162] In summary, the method provided in this application embodiment uses the feature value corresponding to the dynamic link library as the feature value corresponding to the component, and matches the feature value with the candidate feature value in the feature library to realize component identification and obtain the corresponding component information. This enables automated component identification, avoids dependence on manual component identification, adapts to the rapid iteration of the development environment, and avoids difficulty in identifying components used in the application due to lack of manual records when changes occur, thereby improving the accuracy and efficiency of component identification.
[0163] In some embodiments, since applications may have different installation packages for different operating systems, different processing methods are required for component identification depending on the type of installation package. For illustrative examples, please refer to [reference needed]. Figure 4 This document illustrates a flowchart of a system type-based component identification method provided in an exemplary embodiment of this application. This method can be executed by a terminal, a server, or both simultaneously. This embodiment uses terminal execution as an example for illustration. Figure 4 As shown, the steps following step 210 above include the following steps:
[0164] Step 410: Identify the system type of the operating system corresponding to the installation package.
[0165] Optionally, the operating system includes, but is not limited to, at least one of Android, iOS, and Windows systems.
[0166] In some embodiments, the corresponding operating system type can be identified by recognizing the file extension of the installation package.
[0167] For illustrative purposes, if the installation package file extension is ".exe" or ".msi", the corresponding operating system is determined to be Windows; if the installation package file extension is ".apk", the corresponding operating system is determined to be Android; if the installation package file extension is ".deb" or ".rpm", the corresponding operating system is determined to be Linux; and if the installation package file extension is ".ipa", the corresponding operating system is determined to be iOS.
[0168] It is worth noting that the above system types and identification methods are merely illustrative examples, and the embodiments of this application do not limit them.
[0169] Step 420: If the operating system is of type 1, decompile the installation package to obtain the decompilation result.
[0170] The decompiled result includes at least one of a dynamic link library file and a first source code file. The first source code file has a corresponding package name, which is used to uniquely identify the component referenced in the first source code file.
[0171] The first system type can be obtained directly by decompiling the installation package, yielding at least one of the dynamic link library files and the first source code files. This application's embodiments use Android as an example to illustrate the first system type.
[0172] In some embodiments, the installation package can be decompiled using a preset decompilation tool. Different programming languages require different decompilation tools; the decompilation tool used in this embodiment corresponds to the programming language used in the installation package.
[0173] As an example, for the Android system, the installation package can be decompiled to obtain the first source code file, such as the Java source code file. Alternatively, the installation package can be decompiled into intermediate code files first, and then the intermediate code files can be decompiled to obtain the first source code file. For example, the installation package can be decompiled to obtain smali files first, and then the smali files can be decompiled to obtain Java files.
[0174] It is worth noting that the above decompilation methods are merely illustrative examples, and the embodiments of this application do not limit them.
[0175] In some embodiments, after obtaining a Java file, the file package name corresponding to the Java file can be obtained by recognizing the "package" string in the Java code content.
[0176] Step 430: If the decompilation result includes the first source code file, retrieve the component information that matches the file package name from the package name library.
[0177] The package name library includes pre-stored associations between package names and component information.
[0178] For components used by applications in the Android system, some components may be implemented as .so files, while others may be implemented as Java. For components implemented as Java, there is a unique Java package name that can identify the component.
[0179] If the decompiled results include Java files, the components can be identified based on the Java package name.
[0180] To illustrate, when building the package name library, the information collection program traverses the official websites of the component channels to obtain the component information corresponding to at least two candidate components, as well as the SDK corresponding to at least two candidate components; the SDK is parsed to obtain the Java files corresponding to at least two candidate components; the file package name corresponding to the Java file is obtained, and the component information and file package name are associated and written into the package name library.
[0181] Optionally, the package name library can be a database independently constructed for component information and file package names, or it can be part of the database content in the feature library. For example, the feature library includes the association between component information, feature values, and file package names, as shown in Table 1 above.
[0182] As an example, let's take the construction of the feature library shown in Table 1 above as an example. Please refer to... Figure 5 , Figure 5 This is a flowchart of a feature library construction method provided in an exemplary embodiment of this application, such as... Figure 5 As shown, steps 511 to 518 are executed through the information collection program, and steps 521 to 523 are executed in the database. Step 511: Traverse the official website of the component channel; Step 512: Obtain the component version and corresponding update information; Step 513: Obtain the SDK file; Step 514: Parse the SDK file; Step 515: Obtain the JAR package; Step 516: Parse the package name; Step 517: Obtain the SO file; Step 518: Calculate the hash value. Steps 515 and 517 can be executed in parallel, and this embodiment does not limit this. After step 512, step 521 is executed to write the component version and corresponding update information into the database; after step 516, step 522 is executed to write the Java package name into the database; after step 518, step 523 is executed to write the hash value into the database. Steps 522 and 523 can be executed in parallel, and this embodiment does not limit this.
[0183] In some embodiments, the operating system type corresponding to the installation package may also include a second system type. The second system type has closed characteristics compared to the first system type, making it difficult to directly decompile the source code files. For example, the iOS system.
[0184] The component identification process for the second system type includes: if the operating system belongs to the second system type, decompressing the installation package to obtain a first executable file, which is expressed in binary form; decompiling the first executable file to obtain a second executable file, which is expressed in text form; obtaining regular expressions corresponding to at least two candidate feature values in the feature library; performing regular expression matching on the second executable file based on the regular expressions; if there is a file content in the second executable file that matches the regular expression, retrieving the corresponding component information from the feature library based on the candidate feature value corresponding to the regular expression.
[0185] When the feature library includes the association between candidate file package names and components, at least two regular expressions corresponding to candidate file package names can be obtained from the feature library and matched with the second executable file. If there is a regular expression matching between the file content and the file package name in the second executable file, the corresponding component information can be obtained from the feature library based on the candidate file package name corresponding to the regular expression.
[0186] The method provided in this application embodiment offers a component identification approach for a second system type. It can process compressed packages with closed characteristics, making it difficult to directly decompile them into source code files, to obtain executable files in text format. Then, it uses regular expression matching, combining feature values from a feature library or at least one of the file package names, to identify the component information corresponding to the executable file. Improved the comprehensiveness of component identification. .
[0187] In summary, the method provided in this application can process the installation package in a targeted manner based on the system type of the operating system. When the component is implemented in the form of source code, the component information matching it can be obtained from the package name library according to the parsed file package name. When the component is implemented in the form of dynamic link library file, the component information matching it can be obtained from the feature library according to the feature value corresponding to the parsed dynamic link library file. This realizes a multi-dimensional component matching method for the first system type, which can improve the component identification efficiency.
[0188] In some embodiments, the component identification method provided in this application can also perform statistical analysis based on the component identification results. For illustrative purposes, please refer to... Figure 6 , Figure 6This is a flowchart of a component identification and statistics method provided in an exemplary embodiment of this application. This method can be executed by a terminal, a server, or both simultaneously. This embodiment illustrates the method as being executed by a terminal. Figure 6 As shown, the above method includes the following steps:
[0189] Step 610: Automatically obtain at least two installation packages corresponding to at least two applications belonging to the preset application type at regular intervals.
[0190] Taking application download software as an example, application download software is used to provide users with application installation packages and provide users with an application download platform. The application download software needs to periodically identify the components of the installation packages provided in the software in order to analyze whether there are any risks in the components used in the installation packages.
[0191] As an illustration, the program download software can automatically and uniformly acquire the installation packages provided in the software to participate in component identification when the user's online activity is low; or it can set priorities according to the probability of different applications in the software being downloaded at different times, divide the component identification time period according to the priority, and acquire the installation packages provided in the software in batches according to the component identification time period to participate in component identification.
[0192] In some embodiments, by classifying a massive number of applications and obtaining the installation packages of at least two applications belonging to the same application type to participate in component identification, the usage of components corresponding to that application type can be analyzed based on the obtained component information.
[0193] Applications can be categorized according to different dimensions. For example, they can be classified by function into social applications, multimedia applications, and game applications; or by popularity into top applications, ordinary applications, and mini applications.
[0194] It is worth noting that the above application categories and classification methods are merely illustrative examples, and the embodiments of this application do not limit them.
[0195] In illustrative terms, assuming that the component identification method provided in this application is applied to component detection of a first application, and the first application is a social application, then with full authorization, the installation packages of at least two other types of applications belonging to the social type can be obtained to participate in component identification, and the usage of components in the social application can be analyzed based on the obtained component information. Furthermore, based on the usage of components in the social application and the component information obtained by performing component identification on the first application, the components used in the first application can be reconfigured.
[0196] It is worth noting that the above-mentioned scenario of obtaining at least two installation packages to participate in component identification and statistical analysis is merely an exemplary example, and the embodiments of this application do not limit it.
[0197] Step 620: Identify component information corresponding to at least two applications based on at least two installation packages.
[0198] Optionally, the component identification process of at least two installation packages can be executed sequentially, in parallel, or in batches, and this application embodiment does not limit this.
[0199] To illustrate, for each installation package, the system type of the corresponding operating system is identified. For Android systems, the installation package is decompiled to obtain Java files and SO files. The package name of the Java file and the feature value corresponding to the SO file are obtained. Based on at least one of the package name and feature value, the matching component information is obtained from the feature library. For iOS systems, the installation package is decompressed to obtain a binary executable file. The binary executable file is decompiled to obtain a text-based executable file. Based on the feature values in the feature library, regular expression matching is used to search for the existence of a certain component's feature value in the text-based executable file. If it exists, the corresponding component information is obtained.
[0200] Step 630: Count the number of programs that use the first component in at least two applications based on the component information, and determine the risk score of the first component based on the number of programs.
[0201] Risk scores are positively correlated with the number of procedures.
[0202] Risk scores are used to indicate the reliability of a component. The more applications of the same type use the same component, the wider the applicability of the component, the more reliable the component's functions, and the easier it is to obtain from public channels. The lower the risk of using the component.
[0203] To illustrate, for the component information of at least two applications of the same type, the overlap of components used in the two applications is analyzed. The components used in the same type of applications are counted in descending order of the number of programs, and a risk score is determined for each component based on the number of programs. This can help users analyze components with lower risk in the same type of applications. Furthermore, for the same components used in the same type of applications, the component versions used in different applications can be analyzed based on the component information, and the stability of the component version can be analyzed based on the number of programs using the same version of the component.
[0204] In some embodiments, the risk score is calculated based on a weighted average of the application's popularity and the number of applications.
[0205] Indicatively, applications of the same type are sorted by popularity as applications A, B, C, and D. Component information obtained from component identification indicates that applications A and B use component 1 to achieve the first function, while applications C and D use component 2. When the number of applications using the same component is equal, the risk scores for components 1 and 2 are the same. Application popularity is introduced into the risk score determination, with weighted coefficients x, y, z, and w corresponding to applications A, B, C, and D respectively, where x > y > z > w. The risk score determined by the number of applications indicates that component 1 has higher component reliability than component 2.
[0206] It is worth noting that the above analysis scenarios for the usage of components of the same application type are merely illustrative examples, and the embodiments of this application do not limit them.
[0207] In some embodiments, after analyzing the installation package of an application to obtain component information, other components that can be used in the application can be recommended to the user.
[0208] This is an example of displaying recommended component information if the component information meets the recommended requirements.
[0209] Component information indicates the first component currently used by the application, and component recommendation information includes a second component recommended to replace the first component.
[0210] The second component is a component whose component information is pre-stored in the feature library.
[0211] The recommended requirements include at least one of the following:
[0212] The second component and the first component belong to the same component type, and the second component's version was released later than the first component's; or,
[0213] The first component and the second component have the same component function type, and the number of applications using the second component in at least two applications belonging to the same application type is greater than the number of applications using the first component; or,
[0214] The first component is a component used in the first application, and the second component is a component used in the second application. The first and second components have the same component function type. The second application has a higher program rating than the first application. The first application's program rating is calculated based on the number of users, user activity, user usage time, and user ratings.
[0215] In a schematic manner, for the installation package of application A, component identification is performed to obtain component information indicating the first component currently used by application A. If a newer version of the component than the first component is stored in the feature library, a second component is recommended based on component recommendation information. The second component is the latest version of the component corresponding to the first component.
[0216] After identifying that application B, which belongs to the social type, is currently using the first component, component recommendation information can be generated based on the component usage of other applications of the social type. The risk score of the recommended second component indicates that the component reliability is higher than that of the first component. The risk score is determined based on the number of components used by at least two applications of the social type.
[0217] After identifying the first component used by mini-application C through component identification, the second component used by large application D can be referenced. The first and second components have the same component function type. The program score of mini-application C is lower than that of large application D. The program score is determined based on the number of users.
[0218] The method provided in this application can generate component recommendation information based on component information, recommend a second component to the user to replace the first component, help the user analyze the usage of components, and reduce the workload of manual analysis. Improve components Usability of recognition results .
[0219] In summary, the method provided in this application, by analyzing the component information corresponding to applications of the same type, can help users analyze the risks and version stability of components from the perspective of the breadth of component usage, thus expanding the application scenarios of component identification.
[0220] The method provided in this application embodiment realizes a one-stop component detection and identification service platform. For application (App) component detection and identification, users only need to upload the original installation package of the App to generate a detection report. The detection report is sent to the user via email or other means, or the user can log in to the platform to view it on the page. At the same time, the platform saves the historical detection records of each App, which is convenient for comparison, analysis and review of historical results.
[0221] The method provided in this application embodiment does not rely on the component information obtained by the developer when integrating the component. It only requires uploading the installation package file and can quickly (within 30 seconds) output the detection results. The detection content is rich and complete, including information such as component name, category, function, and version number.
[0222] The method provided in this application embodiment can automatically detect a large number of Apps in existing application markets, accumulating big data on App component information and detection results. Based on big data analysis, it can provide real-time data on various dimensions such as the usage ratio of specific component versions and the ratio of mainstream configurations, for development teams to reference and improve software development efficiency based on component identification.
[0223] Figure 7 This is a structural block diagram of a component identification device provided in an exemplary embodiment of this application, such as... Figure 7 As shown, the device includes the following parts:
[0224] The acquisition module 710 is used to acquire the installation package of the application, the installation package including at least one dynamic link library file, the dynamic link library file being used to configure the components used in the application, wherein the dynamic link library file has a corresponding relationship with the components used in the application;
[0225] Processing module 720 is used to obtain the feature value corresponding to the dynamic link library file, the feature value being used to identify the dynamic link library file or the component corresponding to the dynamic link library;
[0226] The processing module 720 is further configured to obtain component information that has a relationship with the feature value from the feature library. The component information is used to indicate the components used by the application. The feature library includes pre-stored relationships between feature values and the component information.
[0227] In some embodiments, the processing module 720 is further configured to:
[0228] Obtain the component information corresponding to at least two candidate components and the candidate feature values corresponding to the candidate components;
[0229] The component information corresponding to the at least two candidate components, as well as the candidate feature values, are associated and stored in the feature library.
[0230] In some embodiments, the processing module 720 is further configured to:
[0231] By traversing the official websites of the component channels through the information collection program, the component information corresponding to the at least two candidate components and the software development kit (SDK) corresponding to the at least two candidate components are obtained respectively.
[0232] Parse the SDK to obtain the dynamic link library files corresponding to the at least two candidate components;
[0233] The hash value corresponding to the dynamic link library file is calculated as the candidate feature value corresponding to the candidate component.
[0234] In some embodiments, the processing module 720 is further configured to:
[0235] In cases where the correspondence indicates a one-to-one correspondence between the component and the dynamic link library file, or where one component corresponds to at least two dynamic link library files, a different feature value is generated for each dynamic link library file, and the feature value is used to uniquely identify the dynamic link library file;
[0236] When the correspondence indicates that at least two components share a dynamic link library file, at least two feature values are generated for the at least two components based on the same dynamic link library file. The feature values are used to uniquely identify the components, wherein the i-th component corresponds to the generation of the i-th feature value, and i is a positive integer.
[0237] In some embodiments, the processing module 720 is further configured to:
[0238] Extract the symbol table from the dynamic link library, wherein the symbol table includes at least one symbol content among function names, variable names, class names, and component names configured in the dynamic link library file;
[0239] Obtain a preset expression, which is a regular expression generated based on component information pre-stored in the feature library;
[0240] Based on the preset expression, the symbol table is matched using regular expressions to obtain at least two symbol contents that match the preset expression;
[0241] Generate at least two feature values corresponding to the dynamic link library file for the at least two symbol contents.
[0242] In some embodiments, the processing module 720 is further configured to:
[0243] Parse the installation package to obtain at least one dynamic link library file;
[0244] The hash value of the dynamic link library file is calculated to obtain the feature value.
[0245] In some embodiments, the processing module 720 is further configured to:
[0246] Decompress the installation package to obtain a decompressed installation package file, which includes a binary file;
[0247] By decoding the installation package file, the binary file can be restored to obtain the plaintext file;
[0248] The at least one dynamic link library file is read from the plaintext file by a preset program, which is a pre-developed program for reading specified content.
[0249] In some embodiments, the processing module 720 is further configured to:
[0250] Identify the system type of the operating system corresponding to the installation package;
[0251] If the operating system belongs to the first system type, the installation package is decompiled to obtain a decompilation result. The decompilation result includes at least one of the dynamic link library file and the first source code file. The first source code file corresponds to a file package name, which is used to uniquely identify the component referenced in the first source code file.
[0252] If the decompiled result includes the first source code file, component information that matches the file package name is obtained from the package name library. The package name library includes pre-stored associations between file package names and component information.
[0253] In some embodiments, the processing module 720 is further configured to:
[0254] If the operating system is of the second system type, the installation package is decompressed to obtain a first executable file, which is expressed in binary form.
[0255] The first executable file is decompiled to obtain a second executable file, which is expressed in text form;
[0256] Obtain the regular expressions corresponding to at least two candidate feature values in the feature library;
[0257] The second executable file is subjected to regular expression matching based on the regular expression. If there is a file content in the second executable file that matches the regular expression, the component information is obtained from the feature library based on the candidate feature value corresponding to the regular expression.
[0258] In some embodiments, the acquisition module 710 is further configured to periodically and automatically acquire at least two installation packages corresponding to at least two applications belonging to a preset application type;
[0259] The processing module 720 is further configured to identify component information corresponding to the at least two applications based on the at least two installation packages;
[0260] The processing module 720 is further configured to count the number of programs using the first component in the at least two applications based on the component information, and determine the risk score of the first component based on the number of programs, wherein the risk score is positively correlated with the number of programs.
[0261] In some embodiments, the processing module 720 is further configured to display component recommendation information when the component information meets the recommendation requirements. The component recommendation information includes a second component recommended to replace the first component, wherein the first component is a component currently used by the application.
[0262] The recommended requirements include at least one of the following:
[0263] The second component and the first component belong to the same component type, and the component version of the second component was released later than that of the first component; or,
[0264] The first component and the second component have the same component function type, and the number of applications using the second component in at least two applications belonging to the same application type is greater than the number of applications using the first component; or,
[0265] The first component is a component used in the first application, and the second component is a component used in the second application. The first component and the second component have the same component function type. The program rating of the second application is higher than that of the first application. The program rating of the first application is calculated based on the number of users, user activity, user usage time, and user ratings.
[0266] In summary, the apparatus provided in this application uses the feature value corresponding to the dynamic link library as the feature value corresponding to the component, and matches the feature value with the candidate feature value in the feature library to realize component identification and obtain the corresponding component information. It can realize automated component identification, avoid dependence on manual component identification, adapt to the rapid iteration of the development environment, and avoid the difficulty in identification due to lack of manual records when the components used in the application change, thereby improving the accuracy and efficiency of component identification.
[0267] It should be noted that the component identification device provided in the above embodiments is only an example of the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0268] Figure 8This illustration shows a structural block diagram of a terminal 800 provided in an exemplary embodiment of this application. The terminal 800 may be a smartphone, tablet computer, MP3 player, MP4 player, laptop computer, or desktop computer. The terminal 800 may also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or other names.
[0269] Typically, terminal 800 includes a processor 801 and a memory 802.
[0270] Processor 801 may include one or at least two processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 801 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). Processor 801 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 801 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 801 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.
[0271] The memory 802 may include one or at least two computer-readable storage media, which may be non-transitory. The memory 802 may also include high-speed random access memory and non-volatile memory, such as one or at least two disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 802 are used to store at least one instruction, which is executed by the processor 801 to implement the component identification method provided in the method embodiments of this application.
[0272] In some embodiments, the terminal 800 also includes other components 803, the type and number of which can be selected based on the functional needs of the terminal 800. Those skilled in the art will understand that... Figure 8The structure shown does not constitute a limitation on terminal 800 and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0273] Embodiments of this application also provide a computer device that can be implemented as follows: Figure 1 The terminal or server shown. The computer device includes a processor and a memory, the memory storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by the processor to implement the component identification method provided in the above-described method embodiments.
[0274] Embodiments of this application also provide a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement the component identification method provided in the above-described method embodiments.
[0275] Embodiments of this application also provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the component identification method provided in the above-described method embodiments.
[0276] Optionally, the computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), solid-state drives (SSDs), or optical discs, etc. The random access memory may include resistive random access memory (ReRAM) and dynamic random access memory (DRAM). The sequence numbers of the embodiments in this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0277] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0278] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A component identification method, characterized in that, The method includes: Obtain the installation package of the application, the installation package including at least one dynamic link library file, the dynamic link library file being used to configure the components used in the application, wherein the dynamic link library file has a corresponding relationship with the components used by the application; Obtain the feature value corresponding to the dynamic link library file, the feature value being used to identify the dynamic link library file or the component corresponding to the dynamic link library file; Component information that is associated with the feature value is obtained from the feature library. The component information is used to indicate the components used by the application. The feature library includes pre-stored associations between feature values and the component information.
2. The method according to claim 1, characterized in that, Before obtaining the component information that is associated with the feature value from the feature library, the method further includes: Obtain the component information corresponding to at least two candidate components and the candidate feature values corresponding to the candidate components; The component information corresponding to the at least two candidate components, as well as the candidate feature values, are associated and stored in the feature library.
3. The method according to claim 2, characterized in that, The step of obtaining the version information and corresponding candidate feature values of at least two candidate components includes: By traversing the official websites of the component channels through the information collection program, the component information corresponding to the at least two candidate components and the software development kit (SDK) corresponding to the at least two candidate components are obtained respectively. Parse the SDK to obtain the dynamic link library files corresponding to the at least two candidate components; The hash value corresponding to the dynamic link library file is calculated as the candidate feature value corresponding to the candidate component.
4. The method according to any one of claims 1 to 3, characterized in that, The step of obtaining the feature value corresponding to the dynamic link library file includes: In cases where the correspondence indicates a one-to-one correspondence between the component and the dynamic link library file, or where one component corresponds to at least two dynamic link library files, a different feature value is generated for each dynamic link library file, and the feature value is used to uniquely identify the dynamic link library file; When the correspondence indicates that at least two components share a dynamic link library file, at least two feature values are generated for the at least two components based on the same dynamic link library file. The feature values are used to uniquely identify the components, wherein the i-th component corresponds to the generation of the i-th feature value, and i is a positive integer.
5. The method according to claim 4, characterized in that, When the correspondence indicates that at least two components share a dynamic link library file, generating at least two feature values for the at least two components based on the same dynamic link library file includes: Extract the symbol table from the dynamic link library, wherein the symbol table includes at least one symbol content among function names, variable names, class names, and component names configured in the dynamic link library file; Obtain a preset expression, which is a regular expression generated based on component information pre-stored in the feature library; Based on the preset expression, the symbol table is matched using regular expressions to obtain at least two symbol contents that match the preset expression; Generate at least two feature values corresponding to the dynamic link library file for the at least two symbol contents.
6. The method according to any one of claims 1 to 3, characterized in that, The step of obtaining the feature value corresponding to the dynamic link library file includes: Parse the installation package to obtain at least one dynamic link library file; The hash value of the dynamic link library file is calculated to obtain the feature value.
7. The method according to claim 6, characterized in that, The process of parsing the installation package to obtain the dynamic link library file includes: Decompress the installation package to obtain a decompressed installation package file, which includes a binary file; By decoding the installation package file, the binary file can be restored to obtain the plaintext file; The at least one dynamic link library file is read from the plaintext file by a preset program, which is a pre-developed program for reading specified content.
8. The method according to any one of claims 1 to 3, characterized in that, After obtaining the application's installation package, the process also includes: Identify the system type of the operating system corresponding to the installation package; If the operating system belongs to the first system type, the installation package is decompiled to obtain a decompilation result. The decompilation result includes at least one of the dynamic link library file and the first source code file. The first source code file corresponds to a file package name, which is used to uniquely identify the component referenced in the first source code file. If the decompiled result includes the first source code file, component information that matches the file package name is obtained from the package name library. The package name library includes pre-stored associations between file package names and component information.
9. The method according to claim 8, characterized in that, After identifying the system type of the operating system corresponding to the installation package, the method further includes: If the operating system is of the second system type, the installation package is decompressed to obtain a first executable file, which is expressed in binary form. The first executable file is decompiled to obtain a second executable file, which is expressed in text form; Obtain the regular expressions corresponding to at least two candidate feature values in the feature library; The second executable file is subjected to regular expression matching based on the regular expression. If there is a file content in the second executable file that matches the regular expression, the component information is obtained from the feature library based on the candidate feature value corresponding to the regular expression.
10. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Automatically retrieve at least two installation packages corresponding to at least two applications belonging to a preset application type at regular intervals; Based on the at least two installation packages, identify the component information corresponding to the at least two applications respectively; The number of programs using the first component in the at least two applications is counted based on the component information, and a risk score for the first component is determined based on the number of programs. The risk score is positively correlated with the number of programs.
11. The method according to any one of claims 1 to 3, characterized in that, After obtaining component information matching the association relationship from the feature library based on the feature value, the method further includes: If the component information meets the recommendation requirements, component recommendation information is displayed. The component recommendation information includes a second component recommended to replace the first component, where the first component is the component currently used by the application. The recommended requirements include at least one of the following: The second component and the first component belong to the same component type, and the component version of the second component was released later than that of the first component; or, The first component and the second component have the same component function type, and the number of applications using the second component in at least two applications belonging to the same application type is greater than the number of applications using the first component; or, The first component is a component used in the first application, and the second component is a component used in the second application. The first component and the second component have the same component function type. The program rating of the second application is higher than that of the first application. The program rating of the first application is calculated based on the number of users, user activity, user usage time, and user ratings.
12. A component identification device, characterized in that, The device includes: An acquisition module is used to acquire the installation package of an application, wherein the installation package includes at least one dynamic link library file, the dynamic link library file is used to configure the components used in the application, and there is a correspondence between the dynamic link library file and the components used by the application; The processing module is used to obtain the feature value corresponding to the dynamic link library file, and the feature value is used to uniquely indicate the correspondence between the dynamic link library file and the component; The processing module is further configured to obtain component information that has a relationship with the feature value from the feature library. The component information is used to indicate the components used by the application. The feature library includes pre-stored relationships between feature values and the component information.
13. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one computer program, the at least one computer program being loaded and executed by the processor to implement the component identification method as described in any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that, The storage medium stores at least one computer program, which is loaded and executed by a processor to implement the component identification method as described in any one of claims 1 to 11.
15. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the component identification method as described in any one of claims 1 to 11.