Compatibility evaluation method and device, electronic equipment and computer readable storage medium
By obtaining the software library files of the software program running and the operating system's software library, comparing interface and symbol version numbers, the compatibility problems caused by operating system version differences are solved, testing efficiency and accuracy are improved, and resource requirements are reduced .
Patent Information
- Application Number
- CN202411190587.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-06
AI Technical Summary
Due to the differences in different operating system versions, software programs may fail when running under different operating system environments due to incompatibility of operating system software library versions, resulting in excessive demand for compatibility testing resources and it is difficult to meet the requirements of software iterative development.
By obtaining the software library files called when the software program is run and the software library of the operating system to be detected, perform compatibility evaluation, find and compare interface names and symbol version numbers, judge the compatibility between the software program and the operating system, avoid actual testing, and improve the Test efficiency.
It significantly improves the efficiency of software program compatibility testing, reduces resource dependence, provides accurate compatibility evaluation results, and reduces testing costs.
Smart Images

Figure CN119088695A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computers, and specifically relates to a compatibility assessment method, device, electronic device, and computer-readable storage medium. Background Art
[0002] After a software program is developed in a development environment, it is usually necessary to support multiple operating system versions according to the needs of different users. Due to differences in different operating system versions, there are even differences in different software libraries for the same operating system version. When a software program released by a developer is run in a different operating system environment, it may fail to run due to incompatibility of the operating system software library version that the software program depends on (such as calling).
[0003] In order to discover compatibility issues between software programs and different operating system software libraries in advance during the software program development stage, it is usually necessary to actually test the software programs under different operating systems and software library configurations. However, with the development of the operating system industry, more and more operating systems and more and more versions have emerged, and correspondingly, software program compatibility testing needs to be performed on more and more operating system versions. However, the actual running of software programs for testing in different operating system environments requires too much software and hardware resources, which can no longer meet the requirements of software iterative development for compatibility testing. Summary of the invention
[0004] In view of this, the purpose of the present application is to provide a compatibility assessment method, device, electronic device and computer-readable storage medium to improve the efficiency of software program compatibility testing.
[0005] The embodiment of the present application is implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides a compatibility assessment method, including: obtaining a software library file called when a software program is running; obtaining a software library of an operating system to be detected; and evaluating whether the software program is compatible with the operating system to be detected based on the software library file called when the software program is running and the software library of the operating system to be detected, thereby obtaining an evaluation result.
[0007] In the above embodiment, by obtaining the software library file called when the software program is running and obtaining the software library of the operating system to be detected, it is evaluated whether the software program is compatible with the operating system to be detected. This compatibility evaluation method does not rely on a large amount of OS (Operating System) deployment and actual testing, and can replace actual testing in the actual OS environment, which can significantly improve testing efficiency and reduce dependence on resources.
[0008] In combination with a possible implementation method of the first aspect, based on the software library files called when the software program is running and the software library of the operating system to be detected, evaluating whether the software program is compatible with the operating system to be detected includes: searching in the software library of the operating system to be detected whether the software library files called when the software program is running exist; if not all the software library files called when the software program is running exist in the software library of the operating system to be detected, obtaining an evaluation result that the software program is incompatible with the operating system to be detected.
[0009] In the above embodiment, only the software library files called when the software program is running are used as a benchmark. By searching in the software library of the operating system to be tested whether the software library files called when the software program is running exist, the evaluation result can be quickly obtained. For example, if not all of them exist, it can be considered that the software program is incompatible with the operating system to be tested.
[0010] In combination with a possible implementation manner of the first aspect, if the software library files called by the software program when running all exist in the software library of the operating system to be detected, the method also includes: obtaining the symbolic name and symbolic version number corresponding to the interface in the software library file called by the software program when running; obtaining the symbolic name and symbolic version number corresponding to the interface provided by the software library of the operating system to be detected; verifying the compatibility of the software program with the operating system to be detected based on the symbolic name and symbolic version number corresponding to the interface called by the software program and the symbolic name and symbolic version number corresponding to the interface provided by the operating system to be detected, and obtaining a verification result.
[0011] In the above embodiment, if the software library files called by the software program when it is running all exist in the software library of the operating system to be detected, considering that it may be incompatible with the operating system to be detected due to different software interfaces or versions, in order to improve the accuracy of the evaluation results, the compatibility of the software program with the operating system to be detected can also be verified based on the symbolic name and symbolic version number corresponding to the interface called by the software program, and the symbolic name and symbolic version number corresponding to the interface provided by the operating system to be detected; through the above verification, the accuracy of the compatibility evaluation can be improved.
[0012] In combination with a possible implementation method of the first aspect, the compatibility of the software program with the operating system to be detected is verified based on the symbolic name and symbolic version number corresponding to the interface called by the software program, and the symbolic name and symbolic version number corresponding to the interface provided by the operating system to be detected, including: comparing the symbolic name and symbolic version number corresponding to the interface called by the software program with the symbolic name and symbolic version number corresponding to the interface provided by the operating system to be detected for consistency; if the interfaces called by the software program can all be found in the software library of the operating system to be detected, and the corresponding symbolic name and symbolic version number are consistent with the symbolic name and symbolic version number provided by the operating system to be detected, a verification result is obtained that the software program is compatible with the operating system to be detected.
[0013] In the above embodiment, by comparing the symbol names and symbol version numbers corresponding to the interfaces called by the software program and provided by the operating system to be detected for consistency, if the interfaces called by the software program can all be found in the software library of the operating system to be detected, and the corresponding symbol names and symbol version numbers are consistent with the symbol names and symbol version numbers provided by the operating system to be detected, then it can be considered that the software program is compatible with the operating system to be detected; otherwise, it is considered incompatible, and the verification provides accurate evaluation information.
[0014] In combination with a possible implementation method of the first aspect, obtaining a software library file called when a software program is running includes: obtaining an executable file corresponding to the software program; parsing the compilation information and link information contained in the executable file to obtain the software library file called when the software program is running.
[0015] In the above embodiment, since the corresponding executable file can be obtained after the software program is compiled and linked, the compilation information and linking information contained in the executable file can be parsed to quickly obtain the software library file called when the software program is running, providing support for subsequent compatibility evaluation.
[0016] In combination with a possible implementation method of the first aspect, obtaining the symbolic name and symbolic version number corresponding to the interface of the software library file called when the software program is running includes: obtaining the executable file corresponding to the software program; and obtaining the symbolic name and symbolic version number corresponding to the interface called when the software program is running based on the symbolic version information recorded in the executable file.
[0017] In the above embodiment, OS compatibility issues are taken into consideration. In addition to differences in software library files, there are also differences in interface names and interface implementation versions caused by differences in software library versions on different OS versions. Symbol versioning is a technology for version control of symbols (such as functions, variables, etc.) in dynamic libraries. It can solve compatibility issues caused by different implementations of interfaces with the same name in software libraries of different versions. Therefore, the symbol name and symbol version number corresponding to the interface called by the software program when it is running can be obtained based on the symbol version information recorded in the executable file corresponding to the software program, so as to verify the compatibility of the software program with the operating system to be tested.
[0018] In combination with a possible implementation method of the first aspect, obtaining the symbolic name and symbolic version number corresponding to the interface provided by the software library of the operating system to be detected includes: obtaining a binary file corresponding to the software library of the operating system to be detected; and obtaining the symbolic name and symbolic version number corresponding to the interface provided by the software library of the operating system to be detected based on the symbolic version information recorded in the binary file.
[0019] In the above embodiment, the symbol version information recorded in the binary file by the symbol versioning mechanism can be used to obtain the symbol name and symbol version number corresponding to the interface provided by the software library of the operating system to be detected, so as to verify the compatibility of the software program with the operating system to be detected.
[0020] In the second aspect, an embodiment of the present application also provides a compatibility assessment device, including: a first acquisition module, a second acquisition module and an assessment module; the first acquisition module is used to acquire a software library file called when a software program is running; the second acquisition module is used to acquire a software library of an operating system to be detected; the assessment module is used to assess whether the software program is compatible with the operating system to be detected based on the software library file called when the software program is running and the software library of the operating system to be detected, and obtain an assessment result.
[0021] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a memory and a processor, the processor being connected to the memory; the memory being used to store programs; the processor being used to call the programs stored in the memory to execute a method provided in the above-mentioned first aspect embodiment and / or any possible implementation method in combination with the first aspect embodiment.
[0022] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method provided in the embodiment of the first aspect and / or any possible implementation method in combination with the embodiment of the first aspect is executed.
[0023] The beneficial effects of the above-mentioned second to fourth aspects of the embodiments are the same as the beneficial effects of the solutions provided by the above-mentioned first aspect of the embodiments and / or any possible implementation method combined with the first aspect of the embodiments.
[0024] Other features and advantages of the present application will be described in the following description. The purpose and other advantages of the present application can be realized and obtained through the structures specifically pointed out in the written description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. The above and other purposes, features and advantages of the present application will be more clear as shown in the drawings.
[0026] Figure 1 A flow chart of a compatibility assessment method provided in an embodiment of the present application is shown.
[0027] Figure 2 A schematic diagram showing the principle of a compatibility assessment method provided in an embodiment of the present application is shown.
[0028] Figure 3 A schematic diagram for comparing symbol names and symbol version numbers provided in an embodiment of the present application is shown.
[0029] Figure 4 A module block diagram of a compatibility assessment device provided in an embodiment of the present application is shown.
[0030] Figure 5 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0031] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The following embodiments can be used as examples to more clearly illustrate the technical solutions of the present application, and cannot be used to limit the scope of protection of the present application. It will be appreciated by those skilled in the art that, in the absence of conflict, the features in the following embodiments and embodiments can be combined with each other.
[0032] It should be noted that similar numbers and letters represent similar items in the following figures, so once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. At the same time, in the description of this application, relational terms such as "first", "second", etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0033] Furthermore, the term "and / or" in this application is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In the description of the embodiments of this application, unless otherwise clearly specified and limited, the technical term "connection" can be a direct connection or an indirect connection through an intermediate medium.
[0034] In order to improve the efficiency of compatibility testing of software programs, an embodiment of the present application provides a compatibility assessment method. This method no longer actually runs the software program under different operating system environments for compatibility testing. Instead, it obtains the software library files called by the software program when it is running and the software library of the operating system (OS) to be tested, and then compares them. In this way, the OS compatibility of the software program can be detected, avoiding the need for a large amount of OS deployment and actual testing, saving testing resources, and improving testing efficiency and results.
[0035] Combine the following Figure 1 The flowchart shown illustrates the principle of the compatibility assessment method provided in the embodiment of the present application.
[0036] S1: Obtain the software library file called when the software program is running.
[0037] When a software program is running, it may call multiple software library files, which provide various functions and resources required by the program. Since the software program needs to rely on various software library files when running, calling the required software library files can run normally. Therefore, compatibility assessment can be performed by obtaining the software library files called by the software program when running.
[0038] The software library files called by different software programs when running can be different. The software library files called by the software program when running can include one or more of dynamic library files, static library files, other files, etc. However, static library files and other files are not related to OS compatibility, and static libraries do not rely on OS software libraries when running. Dynamic libraries, also known as shared libraries, are a form of library files commonly used in software development. Dynamic libraries are shared library files that are loaded into memory when the program is running, usually with suffixes such as .dll (common in Windows systems) or .so (common in Linux systems). It allows the program to call functions and resources in the dynamic library through dynamic linking at runtime.
[0039] In one possible implementation, the software program may be analyzed in advance to obtain the software library files called during its runtime and store them in a database, so that when performing a software program compatibility analysis later, the software library files called during the software program runtime may be obtained from the database.
[0040] In one possible implementation, when a compatibility assessment of a software program is required, the software library file called by the software program when it is running is obtained in real time. For example, in one way, the process of obtaining the software library file called by the software program when it is running may include: obtaining the executable file corresponding to the software program (which may be referred to as the software program executable file or executable file); parsing the compilation information and link information contained in the executable file, and obtaining the software library file called by the software program when it is running according to the parsing result of the software program executable file. The corresponding executable file can be obtained by compiling and linking the software program, and then the compilation information and link information contained in the executable file are parsed, such as parsing the executable file corresponding to the software program based on the binary file format definition, to obtain the software library file called by the software program when it is running. Among them, the executable file is a binary form of a computer program, and the operating system will load the file and load the instructions therein into the computer's memory to start the program execution.
[0041] In one implementation, the software library file may be a dynamic library file, for example, based on the specification definition of the binary file, by parsing the information in the dynamic section of the executable file, a list of dynamic library files called at runtime is generated. For example, for an ELF (Executable and Linkable Format) format executable file of the widely used Linux operating system, a list of dynamic library names called at runtime can be generated by querying the shared library in the dynamic section.
[0042] S2: Obtain the software library of the operating system to be detected.
[0043] After the software program is developed and compiled in the development environment OS, in order to test whether the compiled software program executable file can run normally on other OS (the operating system to be tested), that is, whether the OS is compatible, the software library of the operating system to be tested can be obtained for analysis to evaluate the compatibility of the software program with the operating system to be tested.
[0044] In one possible implementation, the software library provided by the operating system to be detected can be analyzed in advance to obtain the software library provided by it and store it in a database, so that the software library of the operating system to be detected can be obtained from the database when performing software program compatibility analysis later.
[0045] Based on the OS software package management function, without installing the OS, the OS software library installation package can be analyzed to generate information related to the dynamic library files in the OS software library. For example, the software installation package in the OS software release can be analyzed to extract the installation file software library file to generate the OS version, software installation package name, software library file name, symbol name and symbol version number information corresponding to the interface in the software library file, etc. For different OS versions, a software library containing information related to different OS versions can be generated.
[0046] The operating system to be detected includes but is not limited to Linux operating system, Unix system or Windows system.
[0047] S3: Based on the software library file called when the software program is running and the software library of the operating system to be detected, evaluating whether the software program is compatible with the operating system to be detected, and obtaining an evaluation result.
[0048] After obtaining the software library files called when the software program is running and the software library of the operating system to be detected, the software program can be evaluated whether it is compatible with the operating system to be detected based on the software library files called when the software program is running and the software library of the operating system to be detected to obtain an evaluation result.
[0049] In one possible implementation, the software library file called when the software program is running and the software library of the operating system to be detected can be input into the computer for matching. If the software library file called when the software program is running cannot be matched in the software library of the operating system to be detected, it is considered incompatible, otherwise it is compatible.
[0050] In a possible implementation, the implementation process of S3 may include: searching in the software library of the operating system to be detected whether the software library files called by the software program when it is running exist; if the software library files called by the software program when it is running do not all exist in the software library of the operating system to be detected, obtaining an evaluation result that the software program is incompatible with the operating system to be detected. When comparing, the software library files called by the software program when it is running may be used as a reference to search one by one in the software library of the operating system to be detected whether the software library files exist; if not all exist, the software program is considered to be incompatible with the operating system to be detected.
[0051] In one implementation mode, for a Linux system that uses a deb (file format of a debian software package) package or an RPM (Red Hat Package Manager) package, without installing an OS, the management function of the Advanced Package Tool (APT, a software package management tool used in a debian-based Linux distribution) or the RPM software package management tool (a software package management tool used in a Red Hat-based Linux distribution) can be used to query and confirm whether the OS software package contains a dynamic library file called when a software program is running.
[0052] In a possible implementation, if all software library files called by the software program when running exist in the software library of the operating system to be detected, the software program can be considered to be compatible with the operating system to be detected.
[0053] In one possible implementation, if all the software library files called by the software program when it is running exist in the software library of the operating system to be detected, further judgment is required and certain requirements are met before the software program is considered compatible with the operating system to be detected, which can improve the accuracy of the compatibility assessment. In this implementation, the compatibility assessment method also includes: obtaining the symbolic name and symbolic version number corresponding to the interface in the software library file called by the software program when it is running; obtaining the symbolic name and symbolic version number corresponding to the interface provided by the software library of the operating system to be detected; based on the symbolic name and symbolic version number corresponding to the interface called by the software program and the symbolic name and symbolic version number corresponding to the interface provided by the operating system to be detected, the compatibility of the software program and the operating system to be detected is verified to obtain a verification result.
[0054] Among them, the interface in the software library file called when the software program is running includes an interface name and an interface version number, wherein the interface name corresponds to the symbolic name of the binary file compiled by the software program, and the interface version corresponds to the symbolic version number of the binary file compiled by the software program. That is, the interface name and interface version number correspond to the symbolic name and symbolic version number one by one.
[0055] Considering the OS compatibility issue, in addition to differences in software library files, there are also differences in interface names and interface implementation versions caused by differences in software library versions on different OS versions. Although the software library files called by the software program when running all exist in the software library of the operating system to be tested, they may be incompatible with the operating system to be tested due to different software interfaces or versions. In order to improve the accuracy of the evaluation results, the compatibility of the software program with the operating system to be tested can also be verified based on the symbolic name and symbolic version number corresponding to the interface called by the software program and the symbolic name and symbolic version number corresponding to the interface provided by the operating system to be tested.
[0056] In one possible implementation, the process of verifying the compatibility of a software program with an operating system to be detected based on the symbolic name and symbolic version number corresponding to the interface called by the software program and the symbolic name and symbolic version number corresponding to the interface provided by the operating system to be detected may include: the symbolic name and symbolic version number corresponding to the interface called by the software program and the symbolic name and symbolic version number corresponding to the interface provided by the operating system to be detected may be input into a computer for matching; if the two match, they are considered compatible; otherwise, they are incompatible.
[0057] In one possible implementation, the process of verifying the compatibility of a software program with an operating system to be detected based on the symbolic name and symbolic version number corresponding to the interface called by the software program and the symbolic name and symbolic version number corresponding to the interface provided by the operating system to be detected may include: comparing the symbolic name and symbolic version number corresponding to the interface called by the software program with the symbolic name and symbolic version number corresponding to the interface provided by the operating system to be detected for consistency; if the interfaces called by the software program can all be found in the software library of the operating system to be detected, and the corresponding symbolic name and symbolic version number are consistent with the symbolic name and symbolic version number provided by the operating system to be detected, a verification result is obtained that the software program is compatible with the operating system to be detected; conversely, if the interface called by the software program cannot be found in the software library of the operating system to be detected, or the interface called by the software program can be found in the software library of the operating system to be detected, but the corresponding symbolic name and symbolic version number are inconsistent with the symbolic name and symbolic version number provided by the operating system to be detected, a verification result is obtained that the software program is incompatible with the operating system to be detected.
[0058] When obtaining the symbolic name and symbolic version number corresponding to the interface of the software library file called when the software program is running, in one implementation mode, it can be obtained directly from a database. In this implementation mode, the symbolic name and symbolic version number corresponding to the interface of the software library file called when the software program is running can be analyzed in advance, and the symbolic name and symbolic version number corresponding to the interface of the software library file called when the software program is running can be stored in the database for subsequent use.
[0059] When obtaining the symbolic name and symbolic version number corresponding to the interface of the software library file called when the software program is running, in another implementation, the process may include: obtaining the executable file corresponding to the software program, and obtaining the symbolic name and symbolic version number corresponding to the interface called when the software program is running according to the symbolic version information recorded in the executable file. By parsing the executable file of the software program, and according to the parsing result of the executable file of the software program, the symbolic name and symbolic version number corresponding to the interface called when the software program is running are obtained.
[0060] Among them, symbol versioning is a technology for versioning symbols (such as functions, variables, etc.) in dynamic libraries, which can solve compatibility issues caused by different versions of software libraries with the same interface name but different implementations. The symbol version information recorded in the binary file by the symbol versioning mechanism can be used to obtain the symbol name and symbol version number corresponding to the interface called when the software program is running. For example, for an executable file in the ELF format of a Linux system, an ELF file analysis tool can be used to analyze the executable file, and by querying the symbol version information, the symbol name and symbol version number corresponding to the interface called by the executable file are generated.
[0061] For example, Table 1 shows an example of a list of interface names and corresponding version numbers of executable files.
[0062] Table 1
[0063] Symbol version information Interface symbol name Interface symbol version number _ZNSt6localeD1Ev@GLIBCXX_3.4 _ZNSt6localeD1Ev GLIBCXX_3.4 _ZNSt8ios_baseD2Ev@GLIBCXX_3.4 _ZNSt8ios_baseD2Ev GLIBCXX_3.4 malloc@GLIBC_2.2.5 malloc GLIBC_2.2.5 … … … Symbol version information Symbol name n Symbol version number n
[0064] The corresponding symbol name and symbol version number can be obtained by analyzing the symbol version information.
[0065] When obtaining the symbolic name and symbolic version number corresponding to the interface provided by the software library of the operating system to be detected, in one implementation mode, it can be obtained directly from a database. In this implementation mode, the symbolic name and symbolic version number corresponding to the interface provided by the software library of the operating system to be detected can be analyzed in advance, and the obtained symbolic name and symbolic version number corresponding to the interface provided by the software library of the operating system to be detected can be stored in the database for subsequent use.
[0066] When obtaining the symbolic name and symbolic version number corresponding to the interface provided by the software library of the operating system to be detected, under one implementation mode, the process may include: obtaining the binary file corresponding to the software library of the operating system to be detected; obtaining the symbolic name and symbolic version number corresponding to the interface provided by the software library of the operating system to be detected according to the symbolic version information recorded in the binary file. By parsing the binary file corresponding to the software library of the operating system to be detected, according to the binary file parsing result of the OS software library to be detected, the symbolic name and symbolic version number corresponding to the interface provided by the file are obtained. For example, by parsing the dynamic library symbolic version information recorded in the binary file, the interface name and version number information provided by each dynamic library file are generated. For binary files in the ELF format of the Linux system, the dynamic library binary file can be analyzed using an ELF file analysis tool, and the interface and corresponding version number information provided by the dynamic library binary file can be generated by querying the symbolic version information.
[0067] Table 2 is an example of a list of interface names and corresponding version numbers in a dynamic library binary file.
[0068] Table 2
[0069]
[0070] In one implementation, the principle of the above compatibility assessment method is as follows: Figure 2 As shown, first search in the software library of the operating system to be tested for the existence of software library files called when the software program is running. If not all of them exist, it is incompatible. If all of them exist, further judgment is required, that is, based on the symbolic name and symbolic version number corresponding to the interface called by the software program, and the symbolic name and symbolic version number corresponding to the interface provided by the operating system to be tested, the compatibility of the software program and the operating system to be tested is verified.
[0071] In one implementation, the consistency of the content called by the software program and provided to the outside by the OS to be detected can be compared step by step according to the symbolic name and symbolic version number information corresponding to the software library file and interface. The comparison rules in the present invention are as follows: if the software program binary file uses a dynamic library file, which exists in the OS software library to be detected, then continue to parse the binary file content for comparison, otherwise the detection conclusion is incompatible; if the interface called by the software program can be found in the software library file, and the corresponding symbolic name and software version number are consistent, then the detection conclusion is compatible. The comparison rules of software program files (i.e., software library files) and OS software library files are shown as follows: Figure 3 By comparing the consistency of the symbol version information of the calling and called binary files, the compatibility verification result of the software program running on the OS is obtained.
[0072] The present application also provides a compatibility assessment device 100, such as Figure 4 As shown, it includes: a first acquisition module 110 , a second acquisition module 120 and an evaluation module 130 .
[0073] The first acquisition module 110 is used to acquire a software library file called when the software program is running.
[0074] The second acquisition module 120 is used to acquire the software library of the operating system to be detected.
[0075] The evaluation module 130 is used to evaluate whether the software program is compatible with the operating system to be detected based on the software library file called when the software program is running and the software library of the operating system to be detected, and obtain an evaluation result.
[0076] In one implementation, the first acquisition module 110 is used to acquire an executable file corresponding to a software program; and parse the compilation information and link information contained in the executable file to obtain a software library file called when the software program is running.
[0077] In one implementation, the evaluation module 130 is used to search in the software library of the operating system to be detected to see whether the software library files called when the software program is running exist; if not all of the software library files called when the software program is running exist in the software library of the operating system to be detected, an evaluation result is obtained that the software program is incompatible with the operating system to be detected.
[0078] In one implementation manner, the first acquisition module 110 is further used to acquire the symbol name and symbol version number corresponding to the interface in the software library file called when the software program is running.
[0079] In one implementation manner, the second acquisition module 120 is further configured to acquire a symbolic name and a symbolic version number corresponding to an interface provided by a software library of the operating system to be detected.
[0080] In one embodiment, the evaluation module 130 is also used to verify the compatibility of the software program with the operating system to be tested based on the symbolic name and symbolic version number corresponding to the interface called by the software program, and the symbolic name and symbolic version number corresponding to the interface provided by the operating system to be tested, and obtain a verification result.
[0081] In one implementation, the first acquisition module 110 is used to acquire an executable file corresponding to a software program; and obtain a symbolic name and a symbolic version number corresponding to an interface called when the software program is running, based on the symbolic version information recorded in the executable file.
[0082] In one implementation, the second acquisition module 120 is used to obtain a binary file corresponding to the software library of the operating system to be detected; and obtain the symbol name and symbol version number corresponding to the interface provided by the software library of the operating system to be detected based on the symbol version information recorded in the binary file.
[0083] In one implementation mode, the evaluation module 130 is used to compare the symbolic name and symbolic version number corresponding to the interface called by the software program with the symbolic name and symbolic version number corresponding to the interface provided by the operating system to be detected; if the interfaces called by the software program can all be found in the software library of the operating system to be detected, and the corresponding symbolic name and symbolic version number are consistent with the symbolic name and symbolic version number provided by the operating system to be detected, a verification result is obtained that the software program is compatible with the operating system to be detected.
[0084] The compatibility assessment device 100 provided in the embodiment of the present application has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0085] like Figure 5 As shown, Figure 5 The electronic device 200 provided in the embodiment of the present application is shown in the structural block diagram. The electronic device 200 comprises: a transceiver 210, a memory 220, a communication bus 230 and a processor 240.
[0086] The transceiver 210, the memory 220, and the processor 240 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other via one or more communication buses 230 or signal lines. The transceiver 210 is used to send and receive data. The memory 220 is used to store computer programs, such as storing Figure 5 The software function module shown in the figure is the compatibility assessment device 100. The compatibility assessment device 100 includes at least one software function module that can be stored in the memory 220 in the form of software or firmware or fixed in the operating system (OS) of the electronic device 200. The processor 240 is used to execute the executable module stored in the memory 220, such as the software function module or computer program included in the compatibility assessment device 100. For example, the processor 240 is used to execute the above-mentioned compatibility assessment method.
[0087] Among them, the memory 220 can be, but is not limited to, random access memory (Random Access Memory, RAM), read only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable read-only memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.
[0088] The processor 240 may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a graphics processor (GPU), an accelerated processing unit (Accelerated Processing Unit), a multimedia application processor (MAP), a microprocessor, etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present application may be implemented or executed. Alternatively, the processor 240 may also be any conventional processor, etc.
[0089] The electronic device 200 mentioned above includes but is not limited to a tablet, a computer, a server, etc.
[0090] An embodiment of the present application further provides a non-volatile computer-readable storage medium (hereinafter referred to as storage medium), on which a computer program is stored. When the computer program is run by a computer such as the above-mentioned electronic device 200, the compatibility evaluation method shown above is executed.
[0091] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0092] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0093] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0094] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a computer-readable storage medium, including several instructions for enabling a computer device (which can be a personal computer, a laptop, a server, or an electronic device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned computer-readable storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0095] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A compatibility assessment method, characterized in that: include: Obtaining software library files called when the software program is running; Get the software library of the operating system to be tested; Based on the software library file called when the software program is running and the software library of the operating system to be detected, whether the software program is compatible with the operating system to be detected is evaluated to obtain an evaluation result.
2. The compatibility assessment method according to claim 1, characterized in that: According to the software library file called by the software program when it is running and the software library of the operating system to be detected, evaluating whether the software program is compatible with the operating system to be detected includes: In the software library of the operating system to be detected, searching whether the software library file called by the software program when it is running exists; If the software library files called when the software program is running do not all exist in the software library of the operating system to be detected, an evaluation result is obtained that the software program is incompatible with the operating system to be detected.
3. The compatibility assessment method according to claim 2, characterized in that: If all software library files called by the software program when it is running exist in the software library of the operating system to be detected, the method further includes: Obtaining the symbol name and symbol version number corresponding to the interface in the software library file called when the software program is running; Obtaining the symbol name and symbol version number corresponding to the interface provided by the software library of the operating system to be detected; Based on the symbolic name and symbolic version number corresponding to the interface called by the software program, and the symbolic name and symbolic version number corresponding to the interface provided by the operating system to be detected, the compatibility of the software program with the operating system to be detected is verified to obtain a verification result.
4. The compatibility assessment method according to claim 3, characterized in that: According to the symbolic name and symbolic version number corresponding to the interface called by the software program and the symbolic name and symbolic version number corresponding to the interface provided by the operating system to be detected, the compatibility of the software program with the operating system to be detected is verified, including: Comparing the symbolic name and symbolic version number corresponding to the interface called by the software program with the symbolic name and symbolic version number corresponding to the interface provided by the operating system to be detected for consistency; If the interfaces called by the software program can all be found in the software library of the operating system to be detected, and the corresponding symbol names and symbol version numbers are consistent with the symbol names and symbol version numbers provided by the operating system to be detected, a verification result is obtained that the software program is compatible with the operating system to be detected.
5. The compatibility assessment method according to claim 1, characterized in that: Get the software library files called when the software program is running, including: Obtaining the executable file corresponding to the software program; The compilation information and link information contained in the executable file are parsed to obtain a software library file called when the software program is running.
6. The compatibility assessment method according to claim 3, characterized in that: Obtaining the symbolic name and symbolic version number corresponding to the interface of the software library file called when the software program is running, including: Obtaining the executable file corresponding to the software program; According to the symbol version information recorded in the executable file, the symbol name and symbol version number corresponding to the interface called when the software program is running are obtained.
7. The compatibility assessment method according to claim 3, characterized in that: Obtaining the symbolic name and symbolic version number corresponding to the interface provided by the software library of the operating system to be detected, including: Obtaining a binary file corresponding to the software library of the operating system to be detected; According to the symbol version information recorded in the binary file, the symbol name and symbol version number corresponding to the interface provided by the software library of the operating system to be detected are obtained.
8. A compatibility assessment device, characterized in that: include: A first acquisition module is used to acquire a software library file called when the software program is running; A second acquisition module is used to acquire a software library of the operating system to be detected; The evaluation module is used to evaluate whether the software program is compatible with the operating system to be detected based on the software library file called when the software program is running and the software library of the operating system to be detected, and obtain an evaluation result.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is connected to the memory; The memory is used to store programs; The processor is used to call the program stored in the memory to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is executed.
Citation Information
Cited By
Method and device for evaluating compatibility of system calling interface in application software
CN119690806A
Software package management method and device, electronic equipment and storage medium
CN121209937A
