Software suitability test method and device, electronic equipment and storage medium
By identifying and parsing software packages, checking whether the target software is adapted to the target system and outputting the reasons for the inadequacy of software adaptability testing, the problems of low efficiency and high labor cost are solved, and efficient testing and cost reduction are achieved.
Patent Information
- Application Number
- CN202411519630.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-10-29
AI Technical Summary
Software adaptability testing is inefficient and has high labor costs, resulting in incomplete detection of problems, difficult to locate problems, difficult to deal with positioning, and high process costs.
By obtaining the software package of the target software, identifying the software package type, detecting whether the target software is adapted to the target system, and outputting the reason for the inadequacy. Specific methods include parsing software packages, finding dependent rpm packages, recording dynamic libraries, and performing adaptability detection based on function structure and data structure.
It improves the efficiency of software adaptability testing, reduces labor costs, avoids difficulties such as incomplete problem testing and difficult problem location, and enables users to understand the reasons for the disagreement in order to correct it.
Smart Images

Figure CN119512938A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software testing, and in particular to a software adaptability testing method, device, electronic equipment and storage medium. Background Art
[0002] Current domestic operating systems all use a community + adaptation platform approach to create a software ecosystem so that the products of their own operating systems and application software vendors can be incorporated into a user's usage scenario so that they will not be marginalized due to missing functions.
[0003] In the adaptation process, the system manufacturer generally provides solutions + cloud server resources. After the software manufacturer and the system manufacturer reach an adaptation intention, the system resources are allocated to the software manufacturer. The software manufacturer runs and debugs its own software on the system environment, and verifies and modifies the business it is concerned about. After meeting the conditions, submit a test report. Then the adaptation mutual authentication certificate can be issued.
[0004] For business software developers, it is difficult for software developers to have knowledge about the underlying calls of software operation. Operating system manufacturers face many software developers with diverse product types. Even through community mutual assistance, it is difficult to provide support to meet the compatibility and adaptation of all software.
[0005] Moreover, during the entire adaptation process, if software developers conduct the test themselves, there will be difficulties such as "incomplete testing of problems", "difficult problem location", "difficult location processing", and "high process cost". Therefore, software adaptability testing is inefficient and has high labor costs. Summary of the invention
[0006] In view of this, the present invention provides a software adaptability testing method, device, electronic device and storage medium to solve the problems of low efficiency and high labor cost of software adaptability testing.
[0007] In a first aspect, the present invention provides a software adaptability testing method, the method comprising:
[0008] Get the software package corresponding to the target software;
[0009] Identify the software package and determine the software package type corresponding to the software package;
[0010] According to the software package type, detect whether the target software is suitable for the target system;
[0011] If the target software is not compatible with the target system, the reason for the incompatibility is output.
[0012] The software adaptability testing method provided in the embodiment of the present application obtains the software package corresponding to the target software; identifies the software package, determines the software package type corresponding to the software package, and ensures the accuracy of the software package type corresponding to the determined software package. According to the software package type, detect whether the target software is adapted to the target system, and ensure the accuracy of the obtained test results. Therefore, there is no need for R&D personnel to test by themselves, thereby improving the test efficiency, reducing the labor cost, and avoiding the difficulties such as "incomplete problem testing", "difficult problem location", "difficult location processing", and "high process cost". Therefore, the efficiency of software adaptability testing is improved and the labor cost is reduced. In addition, if the target software is not compatible with the target system, the reason for the incompatibility is output, so that the user can understand the reason for the incompatibility, and then can make corrections according to the reason for the incompatibility, which improves the efficiency of correcting the target software, and does not require R&D personnel to find the reason for the incompatibility through multiple tests.
[0013] In an optional implementation, the software package type includes an rpm package type, and detecting whether the target software is adapted to the target system according to the software package type includes:
[0014] Parse the software package to determine at least one dependent rpm package that the software package depends on;
[0015] Find each dependent rpm package in the target system;
[0016] If all dependent rpm packages are found in the target system, each dependent rpm package is recorded and put into the preset database;
[0017] Obtaining a target function structure and a target data structure in a dynamic library called by a program file in the target software;
[0018] Based on the target function structure and target data structure, detect whether the target software is suitable for the target system.
[0019] The software adaptability testing method provided in the embodiment of the present application parses the software package to determine at least one dependent rpm package that the software package depends on, thereby ensuring the accuracy of the at least one dependent rpm package determined. Each dependent rpm package is searched in the target system, so that it can be detected whether the target system supports the software package to call each dependent rpm package. If all dependent rpm packages are found in the target system, each dependent rpm package is recorded, and each dependent rpm package is placed in a preset database, thereby determining whether the target system supports the software package to call each dependent rpm package. Then, the target function structure and target data structure in the dynamic library called by the program file in the target software are obtained, and based on the target function structure and the target data structure, whether the target software is adapted to the target system is detected, thereby ensuring the accuracy of the result of detecting whether the target software is adapted to the target system.
[0020] In an optional embodiment, the method further includes:
[0021] If at least one dependent rpm package is not found in the target system, the dependent rpm package that cannot be found is determined as a missing dependent rpm package, and the target software is determined to be incompatible;
[0022] Correspondingly, if the target software is not compatible with the target system, the reasons for the incompatibility are output, including:
[0023] Based on the dependency relationship between the software package and each dependent rpm package, the missing dependent rpm package is marked to indicate that the missing dependent rpm package cannot be supported by the target system;
[0024] Determine the missing dependent rpm package as the first missing dependent rpm package;
[0025] The incompatibility reason is output to the target user as the missing of each first missing dependency rpm package.
[0026] The software adaptability testing method provided in the embodiment of the present application, if there is at least one dependent rpm package that is not found in the target system, the dependent rpm package that cannot be found is determined as a missing dependent rpm package, and the target software is determined to be incompatible, thereby ensuring the accuracy of the result that the determined target software is incompatible with the target system. Based on the dependency relationship between the software package and each dependent rpm package, the missing dependent rpm package is marked to characterize that the missing dependent rpm package cannot be supported by the target system, so that the R&D personnel can accurately obtain the specific reasons why the target software is incompatible with the target system, and then make adjustments based on the missing dependent rpm package, so as to make the target software adapt to the target system. Then, the missing dependent rpm package is determined as the first missing dependent rpm package; the incompatibility reason is output to the target user as the missing of each first missing dependent rpm package, so that the target user determines that the incompatibility reason is the missing of each first missing dependent rpm package, and it is easy for the target user to understand.
[0027] In an optional implementation, wherein the software package type includes a non-rpm package type, detecting whether the target software is adapted to the target system according to the software package type includes:
[0028] Identify the software package and determine the installation directory corresponding to the software package;
[0029] Traverse the installation directory and select at least one program file therefrom;
[0030] Analyze each program file to determine the dynamic library that each program file depends on;
[0031] For each dynamic library, search for the dynamic library in the target system and the target warehouse corresponding to the target system;
[0032] If all dynamic libraries are found in the target system and / or target warehouse, each found dynamic library is recorded and put into a preset database;
[0033] Parse each program file to obtain the target function structure and target data structure in the dynamic library called by the program file in the target software;
[0034] Based on the target function structure and target data structure, detect whether the target software is suitable for the target system.
[0035] The software adaptability test method provided in the embodiment of the present application identifies the software package, determines the installation directory corresponding to the software package, and ensures the accuracy of the installation directory corresponding to the determined software package. Traverse the installation directory and select at least one program file therefrom; parse each program file to determine the dynamic library on which each program file depends, and ensure the dynamic library on which each program file depends. For each dynamic library, search for the dynamic library in the target system and the target warehouse corresponding to the target system, so as to determine whether the target system supports the target software to call each dynamic library. If all dynamic libraries are found in the target system and / or the target warehouse, record each dynamic library found, and put each dynamic library found into a preset database, so that the target software can call each dynamic library. Parse each program file, obtain the target function structure and target data structure in the dynamic library called by the program file in the target software, and ensure the accuracy of the target function structure and target data structure called by the obtained software package. Based on the target function structure and the target data structure, detect whether the target software is adapted to the target system, and ensure the accuracy of the obtained test results. As a result, there is no need for R&D personnel to test the target software, thereby improving the efficiency of target software adaptation testing.
[0036] In an optional embodiment, the method further includes:
[0037] If there is at least one dynamic library that is not found in the target system and the target warehouse, the dynamic library that is not found is determined as the first missing dynamic library, and it is detected whether there is an rpm package that provides the dynamic library file in the target warehouse;
[0038] If there is an rpm package providing a modified dynamic library file in the target warehouse, then the rpm package providing the modified dynamic library file is modified to generate each first missing dynamic library, and each first missing dynamic library is recorded and put into a preset database;
[0039] If the target warehouse does not provide the rpm package of the dynamic library file, it is determined that the target system does not support the first missing dynamic library, and it is determined that the target software is not compatible with the target system;
[0040] Correspondingly, if the target software is not compatible with the target system, the reasons for the incompatibility are output, including:
[0041] Based on the relationship between the software package and each program file, and the relationship between each program file and each dynamic library, marking the first missing dynamic library to indicate that the first missing dynamic library cannot be supported by the target system;
[0042] Determine the second missing dependency rpm package of the first missing dynamic library dependency;
[0043] The incompatibility reason is output to the target user as the missing second missing dependent rpm package.
[0044] The software adaptability test method provided by the embodiment of the present application, if there is at least one dynamic library that is not found in the target system and the target warehouse, the dynamic library that is not found is determined as the first missing dynamic library, and whether there is an rpm package that provides the dynamic library file in the target warehouse, so as to ensure the accuracy of the obtained test result. If there is an rpm package that provides the dynamic library file in the target warehouse, the rpm package that provides the dynamic library file is modified to generate each first missing dynamic library, and each first missing dynamic library is recorded and put into a preset database, so that the target software can call the missing dynamic library. If there is no rpm package that provides the dynamic library file in the target warehouse, it is determined that the first missing dynamic library is not supported in the target system, and it is determined that the target software is not compatible with the target system. Based on the relationship between the software package and each program file, and the relationship between each program file and each dynamic library, the first missing dynamic library is marked to characterize that the first missing dynamic library cannot be supported by the target system, so that the R&D personnel can obtain the specific reason why the target software is not compatible with the target system, and then make adjustments according to the missing dynamic library, thereby improving the efficiency of the R&D personnel in making adjustments. The second missing dependency rpm package of the first missing dynamic library dependency is determined, ensuring the accuracy of the determined second missing dependency rpm package. The incompatibility reason is output to the target user as the missing second missing dependency rpm package, thereby ensuring that the target user can obtain the incompatibility reason and facilitating the target user to understand.
[0045] In an optional implementation, based on the target function structure and the target data structure, detecting whether the target software is adapted to the target system includes:
[0046] Obtaining a standard operating environment corresponding to the target software; the standard operating environment includes version information of a standard operating system corresponding to the target software;
[0047] Obtaining a first function structure and a data structure set corresponding to a standard operating environment;
[0048] Obtaining a second function structure and a data structure set corresponding to the target system;
[0049] Comparing the first set of function structures and data structures with the second set of function structures and data structures to determine differences between the first set of function structures and data structures and the second set of function structures and data structures;
[0050] generating an ABI difference database table based on a difference between the first set of function structures and data structures and the second set of function structures and data structures;
[0051] Based on the relationship between the ABI difference database table and the target function structure and the target data structure, it is detected whether the target software is adapted to the target system.
[0052] The software adaptability testing method provided in the embodiment of the present application obtains the standard operating environment corresponding to the target software; obtains the first function structure and data structure set corresponding to the standard operating environment, and ensures the accuracy of the first function structure and data structure set obtained. Obtain the second function structure and data structure set corresponding to the target system; compare the first function structure and data structure set with the second function structure and data structure set, determine the difference between the second function structure and data structure set and the second function structure and data structure set, and ensure the accuracy of the difference between the determined second function structure and data structure set and the second function structure and data structure set. Based on the difference between the second function structure and data structure set and the second function structure and data structure set, generate an ABI difference database table to ensure the accuracy of the generated ABI difference database table. Based on the relationship between the ABI difference database table and the target function structure and the target data structure, detect whether the target software is adapted to the target system, so that it can detect whether the target function structure and target data structure on which the target software depends can be supported by the target system, and then the accuracy of the obtained test results can be guaranteed.
[0053] In an optional implementation, wherein the number of the target function structure and the number of the target data structure are both at least one, detecting whether the target software is adapted to the target system based on the relationship between the ABI difference database table and the target function structure and the target data structure includes:
[0054] For each target function structure and each target data structure, searching the target function structure and / or the target data structure in the ABI difference database table;
[0055] If all target function structures and / or target data structures are not found in the ABI difference database table, it is determined that the target system supports all target function structures and / or target data structures, that is, the target software is adapted to the target system.
[0056] The software adaptability testing method provided in the embodiment of the present application searches for the target function structure and / or target data structure in the ABI difference database table for each target function structure and each target data structure; if all the target function structures and / or target data structures are not found in the ABI difference database table, it is determined that the target system supports all the target function structures and / or target data structures, that is, the target software is adapted to the target system, thereby ensuring the accuracy of the determined target software being adapted to the target system.
[0057] In an optional embodiment, the method further includes:
[0058] If the target function structure and / or target data structure exists and is found in the ABI difference database table, it is determined that the target system does not support the found target function structure and / or target data structure, and the target function structure and / or target data structure not supported by the target system is determined to be a missing function structure and / or missing data structure;
[0059] Correspondingly, if the target software is not compatible with the target system, the reasons for the incompatibility are output, including:
[0060] Based on the relationship between the software package and each program file, the relationship between each program file and each dynamic library, and the relationship between each dynamic library and each target function structure and / or target data structure, the missing function structure and / or the missing data structure are marked to indicate that the missing function structure and / or the missing data structure cannot be supported by the target system;
[0061] Determine a second missing dynamic library corresponding to the missing function structure and / or the missing data structure;
[0062] Determine the third missing dependency rpm package corresponding to the second missing dynamic library;
[0063] The incompatibility reason is output to the target user as the missing third dependent rpm package.
[0064] The software adaptability testing method provided by the embodiment of the present application, if there is a target function structure and / or a target data structure, and it is found in the ABI difference database table, it is determined that the target system does not support the target function structure and / or the target data structure found, and the target function structure and / or the target data structure that the target system does not support is determined to be a missing function structure and / or a missing data structure, thereby ensuring the accuracy of the determined missing function structure and / or the missing data structure. Based on the relationship between the software package and each program file, the relationship between each program file and each dynamic library, and the relationship between each dynamic library and each target function structure and / or the target data structure, the missing function structure and / or the missing data structure are marked to characterize that the missing function structure and / or the missing data structure cannot be supported by the target system, thereby ensuring that the R&D personnel can obtain the specific reasons why the target software is not compatible with the target system, thereby adjusting based on the missing function structure and / or the missing data structure to improve the adjustment efficiency. Then, the second missing dynamic library corresponding to the missing function structure and / or the missing data structure is determined, thereby ensuring the accuracy of the determined second missing dynamic library. The third missing dependency rpm package corresponding to the second missing dynamic library is determined, thereby ensuring the accuracy of the determined third missing dependency rpm package. The incompatibility reason is output to the target user as missing the third missing dependency rpm package, which ensures that the target user can obtain the incompatibility reason and is easy for the target user to understand.
[0065] In a second aspect, the present invention provides a software adaptability testing device, the device comprising:
[0066] An acquisition module is used to acquire the software package corresponding to the target software;
[0067] A determination module, used to identify the software package and determine the software package type corresponding to the software package;
[0068] A detection module is used to detect whether the target software is suitable for the target system according to the software package type;
[0069] The output module is used to output the incompatibility reason if the target software is incompatibility with the target system.
[0070] The software adaptability testing device provided in the embodiment of the present application obtains the software package corresponding to the target software; identifies the software package, determines the software package type corresponding to the software package, and ensures the accuracy of the software package type corresponding to the determined software package. According to the software package type, detect whether the target software is adapted to the target system, and ensure the accuracy of the obtained test result. Therefore, there is no need for R&D personnel to test by themselves, thereby improving the test efficiency, reducing the labor cost, and avoiding the difficulties such as "incomplete problem testing", "difficult problem location", "difficult location processing", and "high process cost". Therefore, the efficiency of software adaptability testing is improved and the labor cost is reduced. In addition, if the target software is not compatible with the target system, the reason for the incompatibility is output, so that the user can understand the reason for the incompatibility, and then can make corrections according to the reason for the incompatibility, which improves the efficiency of correcting the target software, and does not require R&D personnel to find the reason for the incompatibility through multiple tests.
[0071] In a third aspect, the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the software adaptability testing method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0072] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the software adaptability testing method of the first aspect or any corresponding embodiment thereof.
[0073] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the software adaptability testing method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0075] Figure 1 is a flowchart of a software adaptability testing method according to an embodiment of the present invention;
[0076] Figure 2 is a flowchart of another software adaptability testing method according to an embodiment of the present invention;
[0077] Figure 3It is a schematic diagram of marking missing dependent rpm packages at a high level in a tree diagram according to an embodiment of the present invention;
[0078] Figure 4 is a flowchart of another software adaptability testing method according to an embodiment of the present invention;
[0079] Figure 5 It is a schematic diagram of finding a missing dynamic library in a network graph and marking the missing dynamic library as missing according to an embodiment of the present invention;
[0080] Figure 6 is a flow chart of “detecting whether target software is adapted to a target system based on a target function structure and a target data structure” according to an embodiment of the present invention;
[0081] Figure 7 is a structural block diagram of a software adaptability testing device according to an embodiment of the present invention;
[0082] Figure 8 It is a schematic diagram of the hardware structure of the electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0083] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0084] It should be noted that the method for software adaptability testing provided in the embodiment of the present application, its execution subject can be a device for software adaptability testing, and the device for software adaptability testing can be implemented as part or all of an electronic device through software, hardware, or a combination of software and hardware, wherein the electronic device can be a server or a terminal, wherein the server in the embodiment of the present application can be a single server or a server cluster composed of multiple servers, and the terminal in the embodiment of the present application can be a smart phone, a personal computer, a tablet computer, a wearable device, and other intelligent hardware devices such as an intelligent robot. In the following method embodiments, the execution subject is an electronic device as an example for explanation.
[0085] According to an embodiment of the present invention, a software adaptability testing method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0086] In this embodiment, a software adaptability testing method is provided, which can be used for the above-mentioned electronic device. Figure 1 is a flow chart of a software adaptability testing method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0087] Step S101, obtaining the software package corresponding to the target software.
[0088] Specifically, the electronic device may receive a software package corresponding to the target software input by a user, or may receive a software package corresponding to the target software sent by other devices.
[0089] Step S102: Identify the software package and determine the software package type corresponding to the software package.
[0090] Optionally, the electronic device may identify the extension of the software package to determine the software package type corresponding to the software package.
[0091] For example, RPM packages usually have an .rpm extension. Non-RPM packages may have an .deb extension (for Debian and Ubuntu systems), .pkg (for macOS), .exe (for Windows), or no extension.
[0092] Optionally, the electronic device may identify the content of the software package and determine the software package type corresponding to the software package.
[0093] Optionally, the electronic device may also identify a file header of the software package to determine a software package type corresponding to the software package.
[0094] The embodiment of the present application does not specifically limit the manner in which the electronic device determines the software package type corresponding to the software package.
[0095] Step S103: detecting whether the target software is compatible with the target system according to the software package type.
[0096] Specifically, the electronic device may determine a preset method corresponding to the software package type according to the software package type, and use the preset method to detect whether the target software is compatible with the target system.
[0097] This step will be described in detail below.
[0098] Step S104: if the target software is not compatible with the target system, the reason for the incompatibility is output.
[0099] Specifically, if the target software is not compatible with the target system, the electronic device may determine the reason for the incompatibility according to the detection process, and then output the reason for the incompatibility.
[0100] This step will be described in detail below.
[0101] The software adaptability testing method provided in the embodiment of the present application obtains the software package corresponding to the target software; identifies the software package, determines the software package type corresponding to the software package, and ensures the accuracy of the software package type corresponding to the determined software package. According to the software package type, detect whether the target software is adapted to the target system, and ensure the accuracy of the obtained test results. Therefore, there is no need for R&D personnel to test by themselves, thereby improving the test efficiency, reducing the labor cost, and avoiding the difficulties such as "incomplete problem testing", "difficult problem location", "difficult location processing", and "high process cost". Therefore, the efficiency of software adaptability testing is improved and the labor cost is reduced. In addition, if the target software is not compatible with the target system, the reason for the incompatibility is output, so that the user can understand the reason for the incompatibility, and then can make corrections according to the reason for the incompatibility, which improves the efficiency of correcting the target software, and does not require R&D personnel to find the reason for the incompatibility through multiple tests.
[0102] In this embodiment, a software adaptability testing method is provided, which can be used for the above-mentioned electronic device. Figure 2 is a flow chart of a software adaptability testing method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0103] Step S201, obtaining the software package corresponding to the target software.
[0104] For details about this step, please refer to the above description of step S101, which will not be elaborated here.
[0105] Step S202: Identify the software package and determine the software package type corresponding to the software package.
[0106] For details about this step, please refer to the above description of step S102, which will not be elaborated here.
[0107] Step S203: detecting whether the target software is compatible with the target system according to the software package type.
[0108] Specifically, the software package type includes an rpm package type, and the above step S203 may include the following steps:
[0109] Step S2031, parsing the software package to determine at least one dependent rpm package that the software package depends on.
[0110] Specifically, the electronic device may call an rpm command to parse the software package, determine at least one dependent rpm package that the software package depends on, and thus obtain an rpm dependency graph.
[0111] Step S2032, searching for each dependent rpm package in the target system.
[0112] Specifically, the electronic device can search for each dependent rpm package in the target system according to the rpm dependency graph.
[0113] Step S2033: If all dependent rpm packages are found in the target system, each dependent rpm package is recorded and put into a preset database.
[0114] Specifically, if all dependent rpm packages are found in the target system, the electronic device records each dependent rpm package and puts each dependent rpm package into a preset database, so as to facilitate the target software to call it.
[0115] Step S2034, obtaining the target function structure and target data structure in the dynamic library called by the program file in the target software.
[0116] Specifically, the electronic device can identify the content in the software package, determine the program files of the software package, and then identify each program file to determine the target function structure and target data structure in each dynamic library called by the program file.
[0117] It should be noted that the target function structure and target data structure called by the software package are located in a dynamic library, and at least one dynamic library can constitute each dependent rpm package. Therefore, the electronic device needs to first search for each dependent rpm package in the target system. If each dependent rpm package is found, it proves that each dynamic library that the target software depends on exists. Then, the electronic device detects whether the target function structure and target data structure called by the software package exist in the dependent dynamic library.
[0118] Step S2035: based on the target function structure and the target data structure, detect whether the target software is adapted to the target system.
[0119] Specifically, the electronic device can search for the target function structure and the target data structure in the target system to detect whether the target software is adapted to the target system.
[0120] This step will be described in detail below.
[0121] Step S2036: If there is at least one dependent rpm package that is not found in the target system, the dependent rpm package that cannot be found is determined as a missing dependent rpm package, and the target software is determined to be incompatible.
[0122] Specifically, if there is at least one missing dependency rpm package that is not found in the target system, the electronic device determines that the target system does not have the missing dependency rpm package, that is, the target system does not support the target software to rely on the missing dependency rpm package. Therefore, the electronic device determines that the target software is not compatible with the target system.
[0123] Step S204: if the target software is not compatible with the target system, the reason for the incompatibility is output.
[0124] Specifically, the above step S204 may include the following steps:
[0125] Step a1: based on the dependency relationship between the software package and each dependent rpm package, the missing dependent rpm package is marked to indicate that the missing dependent rpm package cannot be supported by the target system.
[0126] Optionally, the electronic device can generate a tree diagram based on the dependency relationship between the software package and each dependent rpm package, and mark the missing dependent rpm package as missing in the tree diagram to indicate that the missing dependent rpm package cannot be supported by the target system. Figure 3 As shown, it is a schematic diagram of marking missing dependent rpm packages at the middle level in the tree diagram.
[0127] Optionally, the electronic device may generate a table according to the dependency relationship between the software package and each dependent rpm package, and mark the missing dependent rpm package as missing in the table to indicate that the missing dependent rpm package cannot be supported by the target system.
[0128] Step a2: determining the missing dependent rpm package as the first missing dependent rpm package.
[0129] Specifically, the electronic device determines the missing dependent rpm package as the first missing dependent rpm package.
[0130] Step a3: outputting to the target user the incompatibility reason that each first missing dependency rpm package is missing.
[0131] Specifically, the electronic device outputs to the target user that the incompatibility reason is that each of the first missing dependency rpm packages is missing.
[0132] The target user may be a manufacturer that provides the target software.
[0133] The software adaptability testing method provided in the embodiment of the present application parses the software package to determine at least one dependent rpm package that the software package depends on, thereby ensuring the accuracy of the at least one dependent rpm package determined. Each dependent rpm package is searched in the target system, so that it can be detected whether the target system supports the software package to call each dependent rpm package. If all dependent rpm packages are found in the target system, each dependent rpm package is recorded, and each dependent rpm package is placed in a preset database, thereby determining whether the target system supports the software package to call each dependent rpm package. Then, the target function structure and target data structure in the dynamic library called by the program file in the target software are obtained, and based on the target function structure and the target data structure, whether the target software is adapted to the target system is detected, thereby ensuring the accuracy of the result of detecting whether the target software is adapted to the target system.
[0134] If there is at least one dependent rpm package that is not found in the target system, the dependent rpm package that cannot be found is determined as a missing dependent rpm package, and the target software is determined to be incompatible, thereby ensuring the accuracy of the result that the determined target software is incompatible with the target system. Based on the dependency relationship between the software package and each dependent rpm package, the missing dependent rpm package is marked to characterize that the missing dependent rpm package cannot be supported by the target system, so that the R&D personnel can accurately obtain the specific reasons why the target software is incompatible with the target system, and then make adjustments based on the missing dependent rpm package, so that the target software is adapted to the target system. Then, the missing dependent rpm package is determined as the first missing dependent rpm package; the incompatibility reason is output to the target user as the missing of each first missing dependent rpm package, so that the target user determines that the incompatibility reason is the missing of each first missing dependent rpm package, and it is easy for the target user to understand.
[0135] In this embodiment, a software adaptability testing method is provided, which can be used for the above-mentioned electronic device. Figure 4 is a flow chart of a software adaptability testing method according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:
[0136] Step S301, obtaining the software package corresponding to the target software.
[0137] For details about this step, please refer to the above description of step S201, which will not be elaborated here.
[0138] Step S302: Identify the software package and determine the software package type corresponding to the software package.
[0139] For details about this step, please refer to the above description of step S201, which will not be elaborated here.
[0140] Step S303: Detect whether the target software is compatible with the target system according to the software package type.
[0141] Specifically, the software package type includes a non-rpm package type, and the above step S303 may include the following steps:
[0142] Step S3031, identifying the software package and determining the installation directory corresponding to the software package.
[0143] Optionally, the electronic device may use a software package manager (such as apt, yum, zypper, etc.) to identify the software package and determine the installation directory corresponding to the software package.
[0144] Optionally, the electronic device may use a file search tool such as find or locate to search for configuration files, executable files, etc. of the target software to determine the installation directory corresponding to the software package.
[0145] Optionally, the electronic device uses a command line tool to search for an installation directory corresponding to the software package.
[0146] The embodiment of the present application does not specifically limit the method for determining the installation directory corresponding to the software package.
[0147] Step S3032, traverse the installation directory and filter out at least one program file therefrom.
[0148] Specifically, the electronic device can traverse all files and subdirectories under the installation directory, and then use the "filetype" command to filter out program files. Because these executable programs call system or third-party components to complete their own business functions, the dependencies come from these files.
[0149] Program files may have various extensions, such as .exe (Windows executable file), .sh (Unix / Linux script), .py (Python script), etc.
[0150] The program file may be a binary program file.
[0151] Step S3033, parse each program file to determine the dynamic library that each program file depends on.
[0152] Specifically, the electronic device traverses the screened program files one by one, and uses the "readelf -d" or "ldd" command to obtain a list of dynamic library files that each program file depends on.
[0153] Step S3034: for each dynamic library, search for the dynamic library in the target system and the target warehouse corresponding to the target system.
[0154] Optionally, for each dynamic library, the electronic device can use system tools to find each dynamic library in the target system. For example, in a Linux / Unix system, the electronic device can use ldconfig to find the dynamic link library, and then use locate to find the library file. In a Windows system, the electronic device can use the where command to find the library name.
[0155] Optionally, the electronic device may check a configuration file of the target system, such as / etc / ld.so.conf (Linux) or a related key in a registry (Windows), to determine a search path for the dynamic library, thereby finding the dynamic library in the target system.
[0156] Optionally, the electronic device may use a package manager to search for a dynamic library in a target repository corresponding to the target system.
[0157] Step S3035: If all dynamic libraries are found in the target system and / or target warehouse, each found dynamic library is recorded and put into a preset database.
[0158] Specifically, if all dynamic libraries are found in the target system and / or target warehouse, the electronic device records each dynamic library found and puts each dynamic library found into a preset database, thereby facilitating the target software to call it.
[0159] Step S3036: If there is at least one dynamic library that is not found in the target system and the target warehouse, the dynamic library that is not found is determined as the first missing dynamic library, and it is detected whether there is an rpm package that provides the dynamic library file in the target warehouse.
[0160] Specifically, if there is at least one dynamic library that is not found in the target system and the target warehouse, the unfound dynamic library is determined as the first missing dynamic library, and the "dnf provides" command is used to detect whether there is an rpm package in the target warehouse that provides the dynamic library file.
[0161] Step S3037, if there is an rpm package providing the modified dynamic library file in the target warehouse, then the rpm package providing the modified dynamic library file is modified to generate each first missing dynamic library, and each first missing dynamic library is recorded and put into a preset database.
[0162] Specifically, if there is an rpm package providing the modified dynamic library file in the target warehouse, the electronic device modifies the rpm package providing the modified dynamic library file to generate each first missing dynamic library, and records each first missing dynamic library and puts it into a preset database.
[0163] Step S3038, parse each program file to obtain the target function structure and target data structure in the dynamic library called by the program file in the target software.
[0164] Specifically, the electronic device can use the "readelf -s" command to obtain the target function structure and the target data structure in the dynamic library called by the program file in the target software.
[0165] Step S3039: based on the target function structure and the target data structure, detect whether the target software is adapted to the target system.
[0166] Specifically, the electronic device can search for the target function structure and the target data structure in the target system to detect whether the target software is adapted to the target system.
[0167] This step will be described in detail below.
[0168] Step S30310: If the target warehouse does not provide the rpm package of the dynamic library file, it is determined that the target system does not support the first missing dynamic library, and it is determined that the target software is not compatible with the target system.
[0169] Specifically, if the target warehouse does not provide the rpm package of the dynamic library file, the electronic device determines that the target system does not support the missing dynamic library, and determines that the target software is not compatible with the target system.
[0170] Step S304: if the target software is not compatible with the target system, the reason for the incompatibility is output.
[0171] Specifically, the above step S304 may include the following steps:
[0172] Step b1, based on the relationship between the software package and each program file, and the relationship between each program file and each dynamic library, marking the first missing dynamic library to indicate that the first missing dynamic library cannot be supported by the target system.
[0173] Optionally, the electronic device may generate a network diagram based on the relationship between the software package and each program file, and the relationship between each program file and each dynamic library, and find the missing dynamic library in the network diagram, and mark the missing dynamic library as missing. Figure 5 As shown, it is a schematic diagram of finding the missing dynamic library in the network diagram and marking the missing dynamic library.
[0174] Step b2, determining the second missing dependency rpm package of the first missing dynamic library dependency.
[0175] Specifically, the electronic device may determine the second missing dependent rpm package that the first missing dynamic library depends on according to the relationship between the dynamic library and the rpm package.
[0176] Step b3: outputting to the target user that the incompatibility reason is the missing of the second missing dependency rpm package.
[0177] Specifically, the electronic device may output to the target user that the incompatibility reason is the missing second missing dependency rpm package.
[0178] The software adaptability test method provided in the embodiment of the present application identifies the software package, determines the installation directory corresponding to the software package, and ensures the accuracy of the installation directory corresponding to the determined software package. Traverse the installation directory and select at least one program file therefrom; parse each program file to determine the dynamic library on which each program file depends, and ensure the dynamic library on which each program file depends. For each dynamic library, search for the dynamic library in the target system and the target warehouse corresponding to the target system, so as to determine whether the target system supports the target software to call each dynamic library. If all dynamic libraries are found in the target system and / or the target warehouse, record each dynamic library found, and put each dynamic library found into a preset database, so that the target software can call each dynamic library. Parse each program file, obtain the target function structure and target data structure in the dynamic library called by the program file in the target software, and ensure the accuracy of the target function structure and target data structure called by the obtained software package. Based on the target function structure and the target data structure, detect whether the target software is adapted to the target system, and ensure the accuracy of the obtained test results. As a result, there is no need for R&D personnel to test the target software, thereby improving the efficiency of target software adaptation testing.
[0179] If there is at least one dynamic library that is not found in the target system and the target warehouse, the dynamic library that is not found is determined as the first missing dynamic library, and the target warehouse is detected whether there is an rpm package that provides the changed dynamic library file, thereby ensuring the accuracy of the obtained detection result. If there is an rpm package that provides the changed dynamic library file in the target warehouse, then based on the rpm package that provides the changed dynamic library file, the first missing dynamic libraries are generated, and each first missing dynamic library is recorded and put into a preset database, so that the target software can call the missing dynamic library. If there is no rpm package that provides the changed dynamic library file in the target warehouse, it is determined that the first missing dynamic library is not supported in the target system, and it is determined that the target software is not compatible with the target system. Based on the relationship between the software package and each program file, and the relationship between each program file and each dynamic library, the first missing dynamic library is marked to characterize that the first missing dynamic library cannot be supported by the target system, so that the R&D personnel can obtain the specific reason why the target software is not compatible with the target system, and then adjust according to the missing dynamic library, thereby improving the efficiency of the R&D personnel in making adjustments. The second missing dependent rpm package that the first missing dynamic library depends on is determined to ensure the accuracy of the determined second missing dependent rpm package. The incompatibility reason is output to the target user as missing the second missing dependency rpm package, thereby ensuring that the target user can obtain the incompatibility reason and facilitating the target user to understand it.
[0180] In an optional embodiment of the present application, Figure 6 As shown, the above steps S2035 and 3039 of “detecting whether the target software is adapted to the target system based on the target function structure and the target data structure” may include the following steps:
[0181] Step S401, obtaining the standard operating environment corresponding to the target software.
[0182] The standard operating environment includes version information of the standard operating system corresponding to the target software.
[0183] Specifically, the electronic device may receive a standard operating environment corresponding to the target software input by the user.
[0184] It should be noted that the standard operating environment corresponding to the target software is relatively unpopular and is not within the scope of the operating system for the electronic device provisioning data. In this case, it is necessary to separately provide the installation image file of the operating system and the available software repository connection in order to temporarily provision appropriate callable functions and data structure database tables.
[0185] Step S402: Acquire a first function structure and a data structure set corresponding to the standard operating environment.
[0186] Specifically, the electronic device can identify the standard operating environment and determine the configuration file format and configuration options of the target software. Optionally, the electronic device can use a static code analysis tool to identify functions and data structures, and analyze the API interface of the target software to determine function calls and data flows, thereby obtaining a first function structure and data structure set corresponding to the standard operating environment.
[0187] Step S403: Acquire a second function structure and a data structure set corresponding to the target system.
[0188] Specifically, the electronic device can identify the target system, collect data structure information and function structure information in the target system, and then generate a second function structure and data structure set based on the collected data structure information and function structure information.
[0189] Step S404: compare the first function structure and data structure set with the second function structure and data structure set to determine the difference between the first function structure and data structure set and the second function structure and data structure set.
[0190] Specifically, the electronic device may compare the first function structure and data structure set with the second function structure and data structure set to determine the difference between the first function structure and data structure set and the second function structure and data structure set.
[0191] The difference between the first function structure and the data structure set and the second function structure and the data structure set includes the change, update, deletion and addition of the function structure and / or the data structure.
[0192] Step S405: Generate an ABI difference database table based on the difference between the second function structure and the data structure set and the second function structure and the data structure set.
[0193] Specifically, the electronic device generates an ABI difference database table based on the difference between the second function structure and the data structure set and the second function structure and the data structure set.
[0194] Step S406: based on the relationship between the ABI difference database table and the target function structure and the target data structure, detect whether the target software is adapted to the target system.
[0195] Specifically, the number of the target function structure and the number of the target data structure are both at least one, and the above step S406 may include the following steps:
[0196] Step S4061: for each target function structure and each target data structure, search the target function structure and / or the target data structure in the ABI difference database table.
[0197] Specifically, for each target function structure and each target data structure, the electronic device may search for the target function structure and / or the target data structure in the ABI difference database table.
[0198] Step S4062: If all target function structures and / or target data structures are not found in the ABI difference database table, it is determined that the target system supports all target function structures and / or target data structures, that is, the target software is adapted to the target system.
[0199] Specifically, if all target function structures and / or target data structures are not found in the ABI difference database table, the electronic device determines that the target system supports all target function structures and / or target data structures, that is, the target software is adapted to the target system.
[0200] Step S4063, if the target function structure and / or target data structure exists and is found in the ABI difference database table, it is determined that the target system does not support the found target function structure and / or target data structure, and the target function structure and / or target data structure not supported by the target system is determined to be a missing function structure and / or missing data structure.
[0201] Specifically, if a target function structure and / or target data structure exists and is found in the ABI difference database table, the electronic device determines that the target system does not support the found target function structure and / or target data structure, and determines that the target function structure and / or target data structure that is not supported by the target system is a missing function structure and / or missing data structure.
[0202] Correspondingly, the above step of "if the target software is not compatible with the target system, outputting the reason for the incompatibility" may include the following steps:
[0203] Step S407, based on the relationship between the software package and each program file, the relationship between each program file and each dynamic library, and the relationship between each dynamic library and each target function structure and / or target data structure, the missing function structure and / or the missing data structure are marked to indicate that the missing function structure and / or the missing data structure cannot be supported by the target system.
[0204] Specifically, the electronic device determines the relationship between the software package and each program file, the relationship between each program file and each dynamic library, and the relationship between each dynamic library and each target function structure and / or target data structure based on the analysis of the target software. Then, based on the relationship between the software package and each program file, the relationship between each program file and each dynamic library, and the relationship between each dynamic library and each target function structure and / or target data structure, a network diagram or a relationship table is formed, and then, in the network diagram or the relationship table, missing function structures and / or missing data structures are marked as missing. For example, Figure 7 The diagram shown is a schematic diagram of missing annotations for missing function structures and / or missing data structures in a network diagram.
[0205] Step S408: Determine the second missing dynamic library corresponding to the missing function structure and / or the missing data structure.
[0206] Specifically, the electronic device may determine the second missing dynamic library corresponding to the missing function structure and / or the missing data structure according to the corresponding relationship between the function structure and the data structure and the dynamic library.
[0207] Step S409, determining the third missing dependency rpm package corresponding to the second missing dynamic library.
[0208] Specifically, the electronic device determines the third missing dependency rpm corresponding to the second missing dynamic library according to the corresponding relationship between the dynamic library and the rpm package.
[0209] Step S4010, outputting the incompatibility reason as missing the third missing dependency rpm package.
[0210] Specifically, the electronic device outputs to the target user that the incompatibility reason is the missing of the third missing dependency rpm package.
[0211] The software adaptability testing method provided in the embodiment of the present application obtains the standard operating environment corresponding to the target software; obtains the first function structure and data structure set corresponding to the standard operating environment, thereby ensuring the accuracy of the first function structure and data structure set obtained. Obtain the second function structure and data structure set corresponding to the target system; compare the first function structure and data structure set with the second function structure and data structure set to determine the difference between the second function structure and data structure set and the second function structure and data structure set, thereby ensuring the accuracy of the difference between the determined second function structure and data structure set and the second function structure and data structure set. Based on the difference between the second function structure and data structure set and the second function structure and data structure set, an ABI difference database table is generated, thereby ensuring the accuracy of the generated ABI difference database table.
[0212] Then, for each target function structure and each target data structure, the target function structure and / or target data structure is searched in the ABI difference database table; if all target function structures and / or target data structures are not found in the ABI difference database table, it is determined that the target system supports all target function structures and / or target data structures, that is, the target software is adapted to the target system, thereby ensuring the accuracy of the determined target software adapting to the target system.
[0213] If there is a target function structure and / or target data structure, it is found in the ABI difference database table, then it is determined that the target system does not support the target function structure and / or target data structure found, and the target function structure and / or target data structure that the target system does not support is determined to be a missing function structure and / or missing data structure, which ensures the accuracy of the determined missing function structure and / or missing data structure. Based on the relationship between the software package and each program file, the relationship between each program file and each dynamic library, and the relationship between each dynamic library and each target function structure and / or target data structure, the missing function structure and / or missing data structure are marked to characterize that the missing function structure and / or missing data structure cannot be supported by the target system, thereby ensuring that the R&D personnel can obtain the specific reasons why the target software is not compatible with the target system, thereby adjusting based on the missing function structure and / or missing data structure, and improving the adjustment efficiency. Then, the second missing dynamic library corresponding to the missing function structure and / or missing data structure is determined to ensure the accuracy of the second missing dynamic library determined. The third missing dependency rpm package corresponding to the second missing dynamic library is determined to ensure the accuracy of the third missing dependency rpm package determined. The incompatibility reason is output to the target user as missing the third missing dependency rpm package, which ensures that the target user can obtain the incompatibility reason and is easy for the target user to understand.
[0214] In the present embodiment, a software adaptability testing device is also provided, and this device is used to realize the above-mentioned embodiment and preferred implementation mode, and the description that has been made is not repeated. As used below, the term "module" can realize the combination of software and / or hardware of predetermined function. Although the device described in the following embodiments is preferably realized with software, the realization of hardware, or the combination of software and hardware is also possible and conceived.
[0215] This embodiment provides a software adaptability testing device, such as Figure 7 As shown, including:
[0216] The acquisition module 501 is used to acquire the software package corresponding to the target software;
[0217] A determination module 502 is used to identify the software package and determine the software package type corresponding to the software package;
[0218] A detection module 503 is used to detect whether the target software is compatible with the target system according to the software package type;
[0219] The output module 504 is used to output the incompatibility reason if the target software is incompatibility with the target system.
[0220] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0221] The software adaptability testing device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0222] The embodiment of the present invention also provides an electronic device having the above Figure 7 The software suitability test device shown.
[0223] See also Figure 8 , Figure 8 is a schematic diagram of the structure of an electronic device provided by an optional embodiment of the present invention, such as Figure 8 As shown, the electronic device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 8 A processor 10 is taken as an example.
[0224] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0225] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0226] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0227] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0228] The electronic device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 8 The example of connecting through bus is taken in the following.
[0229] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the electronic device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0230] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0231] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0232] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A software adaptability testing method, characterized in that: The method comprises: Get the software package corresponding to the target software; Identifying the software package and determining the software package type corresponding to the software package; According to the software package type, detecting whether the target software is adapted to the target system; If the target software is not compatible with the target system, the reason for the incompatibility is output.
2. The method according to claim 1, characterized in that in, The software package type includes an rpm package type, and detecting whether the target software is adapted to the target system according to the software package type includes: Parsing the software package to determine at least one dependent rpm package that the software package depends on; Searching for each of the dependent rpm packages in the target system; If all the dependent rpm packages are found in the target system, each of the dependent rpm packages is recorded and put into a preset database; Obtaining a target function structure and a target data structure in a dynamic library called by a program file in the target software; Based on the target function structure and the target data structure, it is detected whether the target software is adapted to the target system.
3. The method according to claim 2, characterized in that The method further comprises: If at least one of the dependent rpm packages is not found in the target system, the dependent rpm package that cannot be found is determined as a missing dependent rpm package, and the target software is determined to be incompatible; Correspondingly, if the target software is not compatible with the target system, the reason for the incompatibility is output, including: Based on the dependency relationship between the software package and each of the dependent rpm packages, marking the missing dependent rpm package to indicate that the missing dependent rpm package cannot be supported by the target system; Determine the missing dependent rpm package as the first missing dependent rpm package; The incompatibility reason is output to the target user as missing of each of the first missing dependency rpm packages.
4. The method according to claim 1, characterized in that: in, The software package type includes a non-rpm package type, and detecting whether the target software is adapted to the target system according to the software package type includes: Identify the software package and determine the installation directory corresponding to the software package; Traversing the installation directory and selecting at least one program file therefrom; Parsing each of the program files to determine the dynamic libraries that each of the program files depends on; For each of the dynamic libraries, searching for the dynamic library in the target system and the target warehouse corresponding to the target system; If all the dynamic libraries are found in the target system and / or the target warehouse, each of the dynamic libraries found is recorded and each of the dynamic libraries found is put into a preset database; Parsing each of the program files to obtain a target function structure and a target data structure in a dynamic library called by the program file in the target software; Based on the target function structure and the target data structure, it is detected whether the target software is adapted to the target system.
5. The method according to claim 4, characterized in that The method further comprises: If at least one of the dynamic libraries is not found in the target system and the target warehouse, the dynamic library that is not found is determined as a first missing dynamic library, and it is detected whether there is an rpm package that provides the dynamic library file in the target warehouse; If the target warehouse has the rpm package providing the modified dynamic library file, modify the rpm package providing the modified dynamic library file to generate each of the first missing dynamic libraries, and record each of the first missing dynamic libraries and put them into the preset database; If the target warehouse does not have the rpm package providing the dynamic library file, it is determined that the target system does not support the first missing dynamic library, and the target software is not compatible with the target system; Correspondingly, if the target software is not compatible with the target system, the reason for the incompatibility is output, including: Based on the relationship between the software package and each of the program files, and the relationship between each of the program files and each of the dynamic libraries, marking the first missing dynamic library to indicate that the first missing dynamic library cannot be supported by the target system; Determine the second missing dependency rpm package of the first missing dynamic library dependency; The incompatibility reason is output to the target user as the missing second missing dependency rpm package.
6. The method according to claim 2 or 4, characterized in that: The detecting whether the target software is adapted to the target system based on the target function structure and the target data structure includes: Acquire a standard operating environment corresponding to the target software; the standard operating environment includes version information of a standard operating system corresponding to the target software; Acquire a first function structure and a data structure set corresponding to the standard operating environment; Acquire a second function structure and a data structure set corresponding to the target system; Comparing the first function structure and data structure set with the second function structure and data structure set to determine the difference between the second function structure and data structure set and the second function structure and data structure set; generating an ABI difference database table based on a difference between the second function structure and the data structure set and the second function structure and the data structure set; Based on the relationship between the ABI difference database table and the target function structure and the target data structure, it is detected whether the target software is adapted to the target system.
7. The method according to claim 6, characterized in that in, The number of the target function structure and the number of the target data structure are both at least one, and detecting whether the target software is adapted to the target system based on the relationship between the ABI difference database table and the target function structure and the target data structure includes: For each of the target function structures and each of the target data structures, searching the target function structure and / or the target data structure in the ABI difference database table; If all of the target function structures and / or the target data structures are not found in the ABI difference database table, it is determined that the target system supports all of the target function structures and / or the target data structures, that is, the target software is adapted to the target system.
8. The method according to claim 7, characterized in that The method further comprises: If the target function structure and / or the target data structure exist and are found in the ABI difference database table, it is determined that the target system does not support the found target function structure and / or the target data structure, and the target function structure and / or the target data structure not supported by the target system is determined to be a missing function structure and / or a missing data structure; Correspondingly, if the target software is not compatible with the target system, the reason for the incompatibility is output, including: Based on the relationship between the software package and each of the program files, the relationship between each of the program files and each of the dynamic libraries, and the relationship between each of the dynamic libraries and each of the target function structures and / or the target data structures, the missing function structure and / or the missing data structure are marked to indicate that the missing function structure and / or the missing data structure cannot be supported by the target system; Determine a second missing dynamic library corresponding to the missing function structure and / or the missing data structure; Determine a third missing dependency rpm package corresponding to the second missing dynamic library; The incompatibility reason is output as the missing of the third missing dependency rpm package.
9. A software adaptability testing device, characterized in that: The device comprises: An acquisition module is used to acquire the software package corresponding to the target software; A determination module, used to identify the software package and determine the software package type corresponding to the software package; A detection module, used to detect whether the target software is adapted to the target system according to the software package type; The output module is used to output the incompatibility reason if the target software is incompatibility with the target system.
10. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the software adaptability testing method according to any one of claims 1 to 8 by executing the computer instructions.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the software adaptability testing method according to any one of claims 1 to 8.
12. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to cause a computer to execute the software adaptability testing method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Adaptation testing method and device of client side application
CN103678096A
Electronic device, cloud system software automatic deployment method and storage medium
CN108847950A
Industrial software compatibility testing method under multiple localization platforms
CN113918452A
Method and device for adapting software package to operating system and electronic equipment
CN117519788A
System migration compatibility evaluation method and device based on migration strategy
CN118363658A