Software Adaptability Testing Method, Device, Electronic Device and Storage Medium
By identifying and parsing the types and dependencies of the target software package, the problems of low efficiency and high labor cost of software adaptability testing are solved, and efficient and accurate software adaptability detection and correction are achieved.
Patent Information
- Application Number
- CN202411519630.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2044-10-29
AI Technical Summary
In the prior art, software adaptability testing is inefficient, labor costs are high, and it is difficult for R&D personnel to accurately identify and locate adaptation problems.
By obtaining the target software package, identifying its type, and parsing and detecting it in the target system based on the type, determining whether it is adaptable and outputting reasons for the inadaptation, including parsing dependent rpm packages, dynamic libraries and function structures, etc.
It improves the efficiency of software adaptability testing, reduces labor costs, and ensures the accuracy of the test results. Users can understand the reasons for the disagreement and correct them, reducing the need for multiple tests.
Smart Images

Figure CN119512938B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software testing, and particularly to a software adaptability testing method, device, electronic device and storage medium. Background Art
[0002] Currently, domestic operating systems all adopt the method of community + adaptation platform to build a software ecosystem, so that the products of their own operating systems and application software manufacturers can be included in a user's usage scenario without being marginalized due to lack of functions.
[0003] In the adaptation process, generally, the system manufacturer provides a solution + cloud server resources. After the software manufacturer reaches an adaptation intention with the system manufacturer, system resources are allocated to the software manufacturer, and the software manufacturer runs and debugs its own software in the system environment, verifies and modifies the business it is concerned about. After meeting the conditions, a test report is submitted. Then, an adaptation mutual recognition certificate can be issued.
[0004] For business software development manufacturers, it is difficult for the personnel developing software business to have knowledge about the underlying calls of software operation. And the operating system manufacturers face many software development manufacturers with a wide variety of product types. Even through the form of community mutual assistance, it is difficult to provide support for all software to achieve compatible adaptation.
[0005] Moreover, in the entire adaptation process, when software developers conduct tests themselves, there will be difficulties such as "incomplete problem detection", "difficult problem location", "difficult problem handling", and "high process cost". Therefore, the software adaptability testing efficiency is low and the labor cost is high. 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 software adaptability testing efficiency and high labor cost.
[0007] In a first aspect, the present invention provides a software adaptability testing method, which includes:
[0008] Obtain a software package corresponding to the target software;
[0009] Identify the software package to determine the software package type corresponding to the software package;
[0010] According to the software package type, detect whether the target software is adapted to the target system;
[0011] If the target software is not adapted to the target system, output the reason for non - adaptation.
[0012] The software adaptability testing method provided by the embodiments of the present application obtains the software package corresponding to the target software; identifies the software package to determine the software package type corresponding to the software package, ensuring the accuracy of the determined software package type. According to the software package type, it detects whether the target software is adapted to the target system, ensuring the accuracy of the obtained detection result. Therefore, it is not necessary for R & D personnel to test by themselves, thus improving the testing efficiency, reducing the labor cost, and avoiding difficulties such as "incomplete problem testing", "difficult problem positioning", "difficult positioning and handling", and "high process cost". Therefore, the software adaptability testing efficiency is improved, and the labor cost is reduced. In addition, if the target software is not adapted to the target system, the reason for non - adaptation is output, so that the user can understand the reason for non - adaptation, and then can make corrections according to the reason for non - adaptation, improving the efficiency of correcting the target software, without the need for R & D personnel to find the reason for non - adaptation through multiple tests.
[0013] In an alternative embodiment, wherein the software package type includes the rpm package type, and according to the software package type, detecting whether the target software is adapted to the target system includes;
[0014] Parse the software package to determine at least one dependent rpm package on which the software package depends;
[0015] Find each dependent rpm package in the target system;
[0016] If all dependent rpm packages are found in the target system, record each dependent rpm package and put each dependent rpm package into a preset database;
[0017] Obtain the target function structure and target data structure in the dynamic library called by the program file in the target software;
[0018] Based on the target function structure and target data structure, detect whether the target software is adapted to the target system.
[0019] The software adaptability testing method provided by the embodiments of the present application parses the software package to determine at least one dependent rpm package on which the software package depends, ensuring the accuracy of the determined at least one dependent rpm package. Find each dependent rpm package in the target system, so as to detect 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, record each dependent rpm package and put each dependent rpm package into a preset database, so as to determine whether the target system supports the software package to call each dependent rpm package. Then, obtain the target function structure and target data structure in the dynamic library called by the program file in the target software, and based on the target function structure and target data structure, detect whether the target software is adapted to the target system, thus ensuring the accuracy of the result of detecting whether the target software is adapted to the target system.
[0020] In an alternative embodiment, the method further includes:
[0021] If at least one dependent RPM package is not found in the target system, the un-found dependent RPM package is determined as a missing dependent RPM package, and it is determined that the target software is not compatible.
[0022] Correspondingly, if the target software is not compatible with the target system, the incompatibility reason is 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] The missing dependent RPM package is determined as the first missing dependent RPM package.
[0025] The target user is output with the incompatibility reason that each first missing dependent RPM package is missing.
[0026] For the software adaptability test method provided by the embodiments of the present application, if at least one dependent RPM package is not found in the target system, the un-found dependent RPM package is determined as a missing dependent RPM package, and it is determined that the target software is not compatible, which ensures the accuracy of the result that the determined target software is not compatible 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 indicate that the missing dependent RPM package cannot be supported by the target system, so that the R & D personnel can accurately obtain the specific reason why the target software is not compatible with the target system, and then adjust according to the missing dependent RPM package, so that the target software is compatible with the target system. Then, the missing dependent RPM package is determined as the first missing dependent RPM package; the target user is output with the incompatibility reason that each first missing dependent RPM package is missing, so that the target user determines that the incompatibility reason is that each first missing dependent RPM package is missing, and it is easy for the target user to understand.
[0027] In an alternative embodiment, wherein the software package type includes non-RPM package types, and according to the software package type, detecting whether the target software is compatible with the target system includes:
[0028] Identify the software package to determine the installation directory corresponding to the software package;
[0029] Traverse the installation directory and filter out at least one program file therefrom;
[0030] Parse each program file to determine the dynamic libraries on which each program file depends;
[0031] For each dynamic library, search for the dynamic library in the target system and the target repository corresponding to the target system;
[0032] If all dynamic libraries are found in the target system and / or the target repository, record each found dynamic library and place each found dynamic library into a preset database;
[0033] Parse each program file to obtain the target function structure and target data structure in the dynamic libraries called by the program files in the target software;
[0034] Based on the target function structure and target data structure, detect whether the target software is adapted to the target system.
[0035] The software adaptability testing method provided by the embodiments of the present application identifies the software package and determines the installation directory corresponding to the software package, ensuring the accuracy of the determined installation directory corresponding to the software package. Traverse the installation directory and filter out at least one program file from it; parse each program file to determine the dynamic libraries on which each program file depends, ensuring the determined dynamic libraries on which each program file depends. For each dynamic library, search for the dynamic library in the target system and the target repository 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 repository, record each found dynamic library and place each found dynamic library into a preset database, so that the target software can call each dynamic library. Parse each program file to obtain the target function structure and target data structure in the dynamic libraries called by the program files in the target software, ensuring the accuracy of the obtained target function structure and target data structure called by the software package. Based on the target function structure and target data structure, detect whether the target software is adapted to the target system, ensuring the accuracy of the obtained detection result. Thus, it is not necessary for R & D personnel to test the target software, thereby improving the efficiency of target software adaptation testing.
[0036] In an alternative 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 repository, determine the unfound dynamic library as the first missing dynamic library, and detect whether there is an rpm package providing the dynamic library file in the target repository;
[0038] If there is an rpm package providing the dynamic library file in the target repository, make modifications based on the rpm package providing the dynamic library file to generate each first missing dynamic library, record each first missing dynamic library, and place it into the preset database;
[0039] If there is no rpm package providing the dynamic library file in the target repository, determine that the first missing dynamic library is not supported in the target system and determine that the target software is not adapted to the target system;
[0040] Correspondingly, if the target software is not compatible with the target system, the reasons for 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, the first missing dynamic library is marked to indicate that the first missing dynamic library cannot be supported by the target system;
[0042] Determine the second missing dependent rpm package on which the first missing dynamic library depends;
[0043] Output to the target user that the reason for incompatibility is the missing second missing dependent rpm package.
[0044] In the software adaptability testing method provided by the embodiments of the present application, if at least one dynamic library is not found in the target system and the target repository, the un-found dynamic library is determined as the first missing dynamic library, and it is detected whether there is an rpm package providing the dynamic library file in the target repository, which ensures the accuracy of the obtained detection result. If there is an rpm package providing the dynamic library file in the target repository, based on the rpm package providing the dynamic library file, changes are made to generate each first missing dynamic library, and each first missing dynamic library is recorded and placed in a preset database, so that the target software can call the missing dynamic library. If there is no rpm package providing the dynamic library file in the target repository, 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 indicate that the first missing dynamic library cannot be supported by the target system, so that the R & D personnel can obtain the specific reasons why the target software is not compatible with the target system, and then make adjustments according to the missing dynamic library, improving the efficiency of the R & D personnel's adjustments. Determining the second missing dependent rpm package on which the first missing dynamic library depends ensures the accuracy of the determined second missing dependent rpm package. Outputting to the target user that the reason for incompatibility is the missing second missing dependent rpm package ensures that the target user can obtain the reason for incompatibility and is convenient for the target user to understand.
[0045] In an alternative embodiment, based on the target function structure and the target data structure, detecting whether the target software is compatible with the target system includes:
[0046] Obtain the standard operating environment corresponding to the target software; the standard operating environment includes the version information of the standard operating system corresponding to the target software;
[0047] Obtain the first function structure data structure set corresponding to the standard operating environment;
[0048] Obtain the second function structure data structure set corresponding to the target system;
[0049] Compare the first set of function structure data structures with the second set of function structure data structures to determine the differences of the second set of function structure data structures relative to the second set of function structure data structures;
[0050] Generate an ABI difference database table based on the differences of the second set of function structure data structures relative to the second set of function structure data structures;
[0051] Detect 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.
[0052] The software adaptability testing method provided by the embodiments of the present application obtains the standard operating environment corresponding to the target software; obtains the first set of function structure data structures corresponding to the standard operating environment, ensuring the accuracy of the obtained first set of function structure data structures. Obtain the second set of function structure data structures corresponding to the target system; compare the first set of function structure data structures with the second set of function structure data structures to determine the differences of the second set of function structure data structures relative to the second set of function structure data structures, ensuring the accuracy of the determined differences of the second set of function structure data structures relative to the second set of function structure data structures. Generate an ABI difference database table based on the differences of the second set of function structure data structures relative to the second set of function structure data structures, ensuring the accuracy of the generated ABI difference database table. Detect 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, so as to detect whether the target function structure and the target data structure relied on by the target software can be supported by the target system, and further ensure the accuracy of the obtained detection result.
[0053] In an alternative embodiment, where the number of target function structures and target data structures is 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, search for 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 by the embodiments 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 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 adapts to the target system, ensuring the accuracy of determining that the target software adapts to the target system.
[0057] In an alternative embodiment, the method further includes:
[0058] If there are target function structures and / or target data structures found in the ABI difference database table, it is determined that the target system does not support the found target function structures and / or target data structures, and the target function structures and / or target data structures that the target system does not support are determined as missing function structures and / or missing data structures;
[0059] Correspondingly, if the target software does not adapt to the target system, the reasons for non - adaptation are output, including:
[0060] Based on the relationships between the software package and each program file, between each program file and each dynamic library, and between each dynamic library and each target function structure and / or target data structure, the missing function structures and / or missing data structures are marked to indicate that the missing function structures and / or missing data structures cannot be supported by the target system;
[0061] Determine the second missing dynamic library corresponding to the missing function structure and / or missing data structure;
[0062] Determine the third missing dependent rpm package corresponding to the second missing dynamic library;
[0063] Output to the target user that the reason for non - adaptation is the missing third missing dependent rpm package.
[0064] In the software adaptability testing method provided by the embodiments of the present application, if a target function structure and / or a target data structure 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 target data structure. The target function structure and / or target data structure not supported by the target system are determined as the missing function structure and / or the missing data structure, ensuring the accuracy of the determined missing function structure and / or missing data structure. Based on the relationships between the software package and each program file, between each program file and each dynamic library, and 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 indicate that the missing function structure and / or missing data structure cannot be supported by the target system, so that it can be ensured that developers can obtain the specific reasons why the target software is not adapted to the target system, and thus adjustments can be made based on the missing function structure and / or missing data structure to improve the adjustment efficiency. Then, the second missing dynamic library corresponding to the missing function structure and / or missing data structure is determined, ensuring the accuracy of the determined second missing dynamic library. The third missing dependent rpm package corresponding to the second missing dynamic library is determined, ensuring the accuracy of the determined third missing dependent rpm package. The reason for the inadaptability output to the target user is that the third missing dependent rpm package is missing, ensuring that the target user can obtain the reason for the inadaptability and facilitating the target user's understanding.
[0065] In a second aspect, the present invention provides a software adaptability testing device, the device comprising:
[0066] An acquisition module, configured to acquire a software package corresponding to the target software;
[0067] A determination module, configured to identify the software package and determine the software package type corresponding to the software package;
[0068] A detection module, configured to detect whether the target software is adapted to the target system according to the software package type;
[0069] An output module, configured to output the reason for the inadaptability if the target software is not adapted to the target system.
[0070] The software adaptability testing device provided by the embodiment of the present application obtains the software package corresponding to the target software; identifies the software package to determine the software package type corresponding to the software package, ensuring the accuracy of the determined software package type. According to the software package type, it detects whether the target software is adapted to the target system, ensuring the accuracy of the obtained detection result. Therefore, it is not necessary for R & D personnel to test by themselves, thereby improving the testing efficiency, reducing the labor cost, and avoiding difficulties such as "incomplete problem testing", "difficult problem positioning", "difficult positioning and handling", and "high process cost". Therefore, the software adaptability testing efficiency is improved and the labor cost is reduced. In addition, if the target software is not adapted to the target system, the reason for non - adaptation is output, so that the user can understand the reason for non - adaptation, and then can correct it according to the reason for non - adaptation, improving the efficiency of correcting the target software, without the need for R & D personnel to find the reason for non - adaptation through multiple tests.
[0071] In a third aspect, the present invention provides an electronic device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to execute the software adaptability testing method according to the first aspect or any corresponding embodiment thereof.
[0072] In a fourth aspect, the present invention provides a computer - readable storage medium, on which computer instructions are stored, and the computer instructions are used to cause a computer to execute the software adaptability testing method according to the first aspect or any corresponding embodiment thereof.
[0073] In a fifth aspect, the present invention provides a computer program product, including computer instructions, and the computer instructions are used to cause a computer to execute the software adaptability testing method according to the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0075] Figure 1 is a flowchart of the software adaptability testing method according to the embodiment of the present invention;
[0076] Figure 2 is a flowchart of another software adaptability testing method according to the embodiment of the present invention;
[0077] Figure 3It is a schematic diagram of missing annotation for missing dependent rpm packages at the level in a tree diagram according to an embodiment of the present invention;
[0078] Figure 4 It is a schematic 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 missing dynamic libraries in a network diagram and performing missing annotation on the missing dynamic libraries according to an embodiment of the present invention;
[0080] Figure 6 It is a schematic flowchart of "detecting whether a 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 It 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 hardware structure diagram of an electronic device according to an embodiment of the present invention. Specific embodiments
[0083] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0084] It should be noted that for the software adaptability testing method provided in the embodiments of the present application, the execution subject may be a software adaptability testing device, and this software adaptability testing device may be implemented as part or all of an electronic device through software, hardware, or a combination of software and hardware. Among them, the electronic device may be a server or a terminal. Among them, the server in the embodiments of the present application may be a single server or a server cluster composed of multiple servers, and the terminal in the embodiments of the present application may be other intelligent hardware devices such as a smart phone, a personal computer, a tablet computer, a wearable device, and a smart robot. In the following method embodiments, the execution subject is taken as an electronic device for illustration.
[0085] According to an embodiment of the present invention, an embodiment of a software adaptability testing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings may be executed in a computer system such as a set of computer executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than here.
[0086] In this embodiment, a software adaptability testing method is provided, which can be used for the above-mentioned electronic device. Figure 1 It is a flowchart of the software adaptability testing method according to an embodiment of the present invention, as Figure 1 shown. The process includes the following steps:
[0087] Step S101, obtain the software package corresponding to the target software.
[0088] Specifically, the electronic device can receive the software package corresponding to the target software input by the user, or receive the software package corresponding to the target software sent by other devices.
[0089] Step S102, identify the software package to determine the software package type corresponding to the software package.
[0090] Optionally, the electronic device can identify the extension name of the software package to determine the software package type corresponding to the software package.
[0091] Exemplarily, an RPM package usually has the extension.rpm. The extension of a non-RPM package may be.deb (for Debian and Ubuntu systems),.pkg (for macOS),.exe (for Windows), or have no extension.
[0092] Optionally, the electronic device can identify the content of the software package to determine the software package type corresponding to the software package.
[0093] Optionally, the electronic device can also identify the file header of the software package to determine the software package type corresponding to the software package.
[0094] The embodiments of the present application do not specifically limit the manner in which the electronic device determines the software package type corresponding to the software package.
[0095] Step S103, according to the software package type, detect whether the target software is adapted to the target system.
[0096] Specifically, the electronic device can determine the 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 adapted to the target system.
[0097] This step will be introduced in detail below.
[0098] Step S104, if the target software is not adapted to the target system, output the non-adaptation reason.
[0099] Specifically, if the target software is not adapted to the target system, the electronic device can determine the non-adaptation reason according to the detection process, and then output the non-adaptation reason.
[0100] This step will be introduced in detail below.
[0101] The software adaptability testing method provided by the embodiments of this application obtains the software package corresponding to the target software; identifies the software package to determine the software package type corresponding to the software package, ensuring the accuracy of the determined software package type. According to the software package type, it detects whether the target software is adapted to the target system, ensuring the accuracy of the obtained detection result. Therefore, it is not necessary for R & D personnel to test by themselves, thus improving the testing efficiency, reducing the labor cost, and avoiding difficulties such as "incomplete problem testing", "difficult problem positioning", "difficult positioning and handling", and "high process cost". Therefore, the software adaptability testing efficiency is improved, and the labor cost is reduced. In addition, if the target software is not adapted to the target system, the reason for non - adaptation is output, so that the user can understand the reason for non - adaptation, and then can make corrections according to the reason for non - adaptation, improving the efficiency of correcting the target software, without the need for R & D personnel to find the reason for non - adaptation 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 It is a flowchart of the software adaptability testing method according to the embodiments of the present invention. As Figure 2 shown, this process includes the following steps:
[0103] Step S201, obtain the software package corresponding to the target software.
[0104] For this step, please refer to the introduction of step S101 above and will not be elaborated here.
[0105] Step S202, identify the software package to determine the software package type corresponding to the software package.
[0106] For this step, please refer to the introduction of step S102 above and will not be elaborated here.
[0107] Step S203, according to the software package type, detect whether the target software is adapted to the target system.
[0108] Specifically, the software package type includes the rpm package type. The above step S203 may include the following steps:
[0109] Step S2031, parse the software package to determine at least one dependent rpm package on which the software package depends.
[0110] Specifically, the electronic device can call the rpm command to parse the software package to determine at least one dependent rpm package on which the software package depends, so as to obtain the rpm dependency graph.
[0111] Step S2032, search 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, record each dependent rpm package and place each dependent rpm package 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 places each dependent rpm package into a preset database, so as to facilitate the target software to call.
[0115] Step S2034, obtain 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 to determine the program files of the software package. Then, identify each program file to determine the target function structure and target data structure in the dynamic libraries called by the program files.
[0117] It should be noted that the target function structure and target data structure called by the software package are located in the dynamic library, and at least one dynamic library can form 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 the dynamic libraries on which the target software depends exist. Then, the electronic device detects whether the target function structure and target data structure called by the software package exist in the dependent dynamic libraries.
[0118] Step S2035, based on the target function structure and 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 target data structure in the target system to detect whether the target software is adapted to the target system.
[0120] This step will be introduced in detail below.
[0121] Step S2036, if at least one dependent rpm package is not found in the target system, determine the dependent rpm package that cannot be found as a missing dependent rpm package and determine that the target software is not adapted.
[0122] Specifically, if at least one missing dependent RPM package is not found in the target system, the electronic device determines that the target system does not have the missing dependent RPM package, that is, the target system does not support the target software depending on the missing dependent 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, output the reason for incompatibility.
[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, label the missing dependent RPM package to indicate that the missing dependent RPM package cannot be supported by the target system.
[0126] Optionally, the electronic device may generate a tree diagram according to the dependency relationship between the software package and each dependent RPM package, and perform missing labeling on the missing dependent RPM package in the tree diagram to indicate that the missing dependent RPM package cannot be supported by the target system. Exemplarily, as Figure 3 shown, it is a schematic diagram of performing missing labeling on the missing dependent RPM package 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 perform missing labeling on the missing dependent RPM package in the table diagram to indicate that the missing dependent RPM package cannot be supported by the target system.
[0128] Step a2, determine 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, output to the target user that the reason for incompatibility is the missing of each first missing dependent RPM package.
[0131] Specifically, the electronic device outputs to the target user that the reason for incompatibility is the missing of each first missing dependent RPM package.
[0132] Among them, the target user may be the manufacturer that provides the target software.
[0133] The software adaptability testing method provided by the embodiment of the present application parses the software package to determine at least one dependent rpm package on which the software package depends, ensuring the accuracy of the determined at least one dependent rpm package. Search for each dependent rpm package in the target system, so as to detect whether the target system supports the software package to call each dependent rpm package. If all the dependent rpm packages are found in the target system, record each dependent rpm package and put each dependent rpm package into a preset database, so as to determine whether the target system supports the software package to call each dependent rpm package. Then, obtain the target function structure and target data structure in the dynamic library called by the program file in the target software, and based on the target function structure and target data structure, detect whether the target software is adapted to the target system, thus ensuring the accuracy of the result of detecting whether the target software is adapted to the target system.
[0134] If at least one dependent rpm package is not found in the target system, determine the dependent rpm package that cannot be found as a missing dependent rpm package, and determine that the target software is not adapted, ensuring the accuracy of the result that the determined target software is not adapted to the target system. Based on the dependency relationship between the software package and each dependent rpm package, label the missing dependent rpm package to indicate that the missing dependent rpm package cannot be supported by the target system, so that the R & D personnel can accurately obtain the specific reason why the target software is not adapted to the target system, and then make adjustments according to the missing dependent rpm package, so that the target software is adapted to the target system. Then, determine the missing dependent rpm package as the first missing dependent rpm package; output to the target user that the reason for non - adaptation is the missing of each first missing dependent rpm package, so that the target user can determine that the reason for non - adaptation is the missing of each first missing dependent rpm package and it is convenient 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 It is a flowchart of the software adaptability testing method according to the embodiment of the present invention, as Figure 4 shown, and this process includes the following steps:
[0136] Step S301, obtain the software package corresponding to the target software.
[0137] For this step, please refer to the introduction of step S201 above and will not be elaborated here.
[0138] Step S302, identify the software package to determine the software package type corresponding to the software package.
[0139] For this step, please refer to the introduction of step S201 above and will not be elaborated here.
[0140] Step S303, according to the software package type, detect whether the target software is adapted to the target system.
[0141] Specifically, the software package type includes non-rpm package types. The above step S303 may include the following steps:
[0142] Step S3031: Identify the software package to determine 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 find the installation directory corresponding to the software package.
[0146] The embodiments of the present application do 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 from it.
[0148] Specifically, the electronic device may traverse all files and subdirectories under the installation directory, and then use the "filetype" command to filter out program files. Since these executable programs call system or third-party components to complete their own business functions, the dependencies come from these files.
[0149] Among them, program files may have multiple extensions, such as.exe (Windows executable file),.sh (Unix / Linux script),.py (Python script), etc.
[0150] Among them, the program file may be a binary program file.
[0151] Step S3033: Parse each program file to determine the dynamic libraries on which each program file depends.
[0152] Specifically, the electronic device traverses each of the filtered program files one by one and uses the "readelf -d" or "ldd" command to obtain the list of dynamic library files on which each program file depends.
[0153] Step S3034: For each dynamic library, search for the dynamic library in the target system and the target repository corresponding to the target system.
[0154] Optionally, for each dynamic library, the electronic device can use system tools to search for each dynamic library in the target system. For example, in a Linux / Unix system, the electronic device can use ldconfig to search for dynamic link libraries and then use locate to search for library files. In a Windows system, the electronic device can use the where command to search for library names.
[0155] Optionally, the electronic device can view the configuration file of the target system, such as / etc / ld.so.conf (Linux) or the relevant key in the registry (Windows), to determine the search path of the dynamic library, so as to search for the dynamic library in the target system.
[0156] Optionally, the electronic device can use the package manager to search for dynamic libraries in the target repository corresponding to the target system.
[0157] Step S3035, if all dynamic libraries are found in the target system and / or the target repository, record each found dynamic library and put each found dynamic library into a preset database.
[0158] Specifically, if all dynamic libraries are found in the target system and / or the target repository, the electronic device records each found dynamic library and puts each found dynamic library into a preset database, so as to facilitate the target software to call.
[0159] Step S3036, if there is at least one dynamic library not found in the target system and the target repository, determine the unfound dynamic library as the first missing dynamic library, and detect whether there is an rpm package providing the dynamic library file in the target repository.
[0160] Specifically, if there is at least one dynamic library not found in the target system and the target repository, determine the unfound dynamic library as the first missing dynamic library, and use the "dnf provides" command to detect whether there is an rpm package providing the dynamic library file in the target repository.
[0161] Step S3037, if there is an rpm package providing the dynamic library file in the target repository, make changes based on the rpm package providing the dynamic library file to generate each first missing dynamic library, record each first missing dynamic library, and put them into a preset database.
[0162] Specifically, if there is an rpm package providing the dynamic library file in the target repository, the electronic device makes changes based on the rpm package providing the dynamic library file to generate each first missing dynamic library, records each first missing dynamic library, and puts them 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 files in the target software.
[0164] Specifically, the electronic device can use the "readelf - s" command to obtain the target function structure and target data structure in the dynamic library called by the program files in the target software.
[0165] Step S3039: Based on the target function structure and target data structure, detect whether the target software is compatible with the target system.
[0166] Specifically, the electronic device can search for the target function structure and target data structure in the target system to detect whether the target software is compatible with the target system.
[0167] This step will be introduced in detail below.
[0168] Step S30310: If the rpm package of the dynamic library file is not provided in the target repository, determine that the target system does not support the first missing dynamic library and determine that the target software is not compatible with the target system.
[0169] Specifically, if the rpm package of the dynamic library file is not provided in the target repository, 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, output the reason for incompatibility.
[0171] Specifically, the above - mentioned 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, label 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 can generate a network graph according to 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 graph to perform a missing label on the missing dynamic library. Exemplarily, as Figure 5 shown, it is a schematic diagram of finding the missing dynamic library in the network graph and performing a missing label on the missing dynamic library.
[0174] Step b2: Determine the second missing dependent rpm package on which the first missing dynamic library depends.
[0175] Specifically, the electronic device can determine the second missing dependent rpm package on which the first missing dynamic library depends according to the relationship between the dynamic library and the rpm package.
[0176] Step b3: Output to the target user that the reason for incompatibility is the lack of the second missing dependent rpm package.
[0177] Specifically, the electronic device can output to the target user that the reason for incompatibility is the lack of the second missing dependent rpm package.
[0178] The software adaptability testing method provided by the embodiments of this application identifies software packages and determines the installation directories corresponding to the software packages, ensuring the accuracy of the determined installation directories corresponding to the software packages. Traverse the installation directories, and filter out at least one program file from them; parse each program file to determine the dynamic libraries relied on by each program file, ensuring the dynamic libraries relied on by each determined program file. For each dynamic library, search for the dynamic library in the target system and the target repository 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 repository, record each found dynamic library and put each found dynamic library into a preset database, so that the target software can call each dynamic library. Parse each program file to obtain the target function structure and target data structure in the dynamic libraries called by the program files in the target software, ensuring the accuracy of the target function structure and target data structure called by the obtained software package. Based on the target function structure and target data structure, detect whether the target software is adapted to the target system, ensuring the accuracy of the obtained detection result. Thus, it is not necessary for R & D personnel to test the target software, thereby improving the efficiency of the target software adaptation test.
[0179] If at least one dynamic library cannot be found in the target system and the target repository, the un-found dynamic library is determined as the first missing dynamic library, and it is detected whether there is an RPM package providing the dynamic library file in the target repository, ensuring the accuracy of the obtained detection result. If there is an RPM package providing the dynamic library file in the target repository, changes are made based on the RPM package providing the dynamic library file to generate each first missing dynamic library, and each first missing dynamic library is recorded and placed in a preset database, so that the target software can call the missing dynamic library. If there is no RPM package providing the dynamic library file in the target repository, 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. 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 labeled to indicate 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, improving the efficiency of the R & D personnel in making adjustments. The second missing dependent RPM package on which the first missing dynamic library depends is determined, ensuring the accuracy of the determined second missing dependent RPM package. The reason for the incompatibility, which is the missing second missing dependent RPM package, is output to the target user, ensuring that the target user can obtain the reason for the incompatibility and facilitating the target user's understanding.
[0180] In an alternative embodiment of the present application, as Figure 6 shown, the "detecting whether the target software is compatible with the target system based on the target function structure and the target data structure" in the above step S2035 and step 3039 may include the following steps:
[0181] Step S401, obtain the standard running environment corresponding to the target software.
[0182] Among them, the standard running environment includes the version information of the standard running system corresponding to the target software.
[0183] Specifically, the electronic device may receive the standard running environment corresponding to the target software input by the user.
[0184] It should be noted that the standard running environment corresponding to the target software is relatively unpopular and not within the operating system range of the data prepared by the electronic device. In this case, it is necessary to separately provide the installation image file of the operating system and the connection to the available software repository to temporarily prepare a suitable callable function and data structure database table.
[0185] Step S402, obtain the first function structure data structure set corresponding to the standard running 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, analyze the API interfaces of the target software, determine function calls and data flows, so as to obtain the first function structure data structure set corresponding to the standard operating environment.
[0187] Step S403: Obtain the second function structure data structure set corresponding to the target system.
[0188] Specifically, the electronic device can identify the target system, collect the data structure information and function structure information in the target system, and then generate the second function structure data structure set based on the collected data structure information and function structure information.
[0189] Step S404: Compare the first function structure data structure set with the second function structure data structure set to determine the differences between the second function structure data structure set and the second function structure data structure set.
[0190] Specifically, the electronic device can compare the first function structure data structure set with the second function structure data structure set to determine the differences between the second function structure data structure set and the second function structure data structure set.
[0191] Among them, the differences between the second function structure data structure set and the second function structure data structure set include changes, updates, deletions, and additions of function structures and / or data structures.
[0192] Step S405: Generate an ABI difference database table based on the differences between the second function structure data structure set and the second function structure data structure set.
[0193] Specifically, the electronic device generates an ABI difference database table based on the differences between the second function structure data structure set and the second function structure data structure set.
[0194] Step S406: Detect whether the target software is compatible with the target system based on the relationship between the ABI difference database table and the target function structure and target data structure.
[0195] Specifically, the number of the target function structure and the target data structure is at least one. The above step S406 may include the following steps:
[0196] Step S4061: For each target function structure and each target data structure, search for the target function structure and / or target data structure in the ABI difference database table.
[0197] Specifically, for each target function structure and each target data structure, the electronic device can 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 there are target function structures and / or target data structures found in the ABI difference database table, it is determined that the target system does not support the found target function structures and / or target data structures, and the target function structures and / or target data structures not supported by the target system are determined as missing function structures and / or missing data structures.
[0201] Specifically, if there are target function structures and / or target data structures found in the ABI difference database table, the electronic device determines that the target system does not support the found target function structures and / or target data structures, and determines the target function structures and / or target data structures not supported by the target system as missing function structures and / or missing data structures.
[0202] Correspondingly, the above step "if the target software is not adapted to the target system, output the reason for non - adaptation" may include the following steps:
[0203] Step S407, based on the relationships between the software package and each program file, between each program file and each dynamic library, and between each dynamic library and each target function structure and / or target data structure, label the missing function structures and / or missing data structures to indicate that the missing function structures and / or missing data structures cannot be supported by the target system.
[0204] Specifically, the electronic device determines the relationships between the software package and each program file, between each program file and each dynamic library, and between each dynamic library and each target function structure and / or target data structure according to the analysis of the target software. Then, based on the relationships between the software package and each program file, between each program file and each dynamic library, and between each dynamic library and each target function structure and / or target data structure, a network diagram or a relationship table is formed. Then, in the network diagram or the relationship table, missing labels are made for the missing function structures and / or missing data structures. Exemplarily, such asFigure 7 The figure shows a schematic diagram of missing annotation for missing function structures and / or missing data structures in a network graph.
[0205] Step S408: Determine a second missing dynamic library corresponding to the missing function structure and / or the missing data structure.
[0206] Specifically, the electronic device can 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: Determine a third missing dependent rpm package corresponding to the second missing dynamic library.
[0208] Specifically, the electronic device determines the third missing dependent rpm corresponding to the second missing dynamic library according to the corresponding relationship between the dynamic library and the rpm package.
[0209] Step S4010: Output that the reason for incompatibility is the missing third missing dependent rpm package.
[0210] Specifically, the electronic device outputs to the target user that the reason for incompatibility is the missing third missing dependent rpm package.
[0211] The software adaptability testing method provided by the embodiments of the present application obtains the standard operating environment corresponding to the target software; obtains the first function structure data structure set corresponding to the standard operating environment, ensuring the accuracy of the obtained first function structure data structure set. Obtains the second function structure data structure set corresponding to the target system; compares the first function structure data structure set with the second function structure data structure set to determine the difference between the second function structure data structure set and the second function structure data structure set, ensuring the accuracy of the determined difference between the second function structure data structure set and the second function structure data structure set. Generates an ABI difference database table based on the difference between the second function structure data structure set and the second function structure data structure set, ensuring the accuracy of the generated ABI difference database table.
[0212] Then, for each target function structure and each target data structure, search for the target function structure and / or the target data structure 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, ensuring the accuracy of the determined adaptation of the target software to the target system.
[0213] If a target function structure and / or a target data structure 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. The target function structure and / or target data structure that the target system does not support is taken as a missing function structure and / or a missing data structure, ensuring the accuracy of the determined missing function structure and / or missing data structure. Based on the relationships between the software package and each program file, between each program file and each dynamic library, and between each dynamic library and each target function structure and / or target data structure, the missing function structure and / or missing data structure is labeled to indicate that the missing function structure and / or missing data structure cannot be supported by the target system, so that it can be ensured that developers can obtain the specific reasons why the target software is not adapted to the target system, and thus adjustments can be made based on the missing function structure and / or missing data structure to improve the adjustment efficiency. Then, the second missing dynamic library corresponding to the missing function structure and / or missing data structure is determined, ensuring the accuracy of the determined second missing dynamic library. The third missing dependent rpm package corresponding to the second missing dynamic library is determined, ensuring the accuracy of the determined third missing dependent rpm package. The reason for the mismatch, which is the missing third missing dependent rpm package, is output to the target user, ensuring that the target user can obtain the reason for the mismatch and facilitating the target user's understanding.
[0214] In this embodiment, a software adaptability testing device is also provided. This device is used to implement the above-mentioned embodiments and preferred implementation manners, and those that have been described will not be repeated here. As used hereinafter, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0215] This embodiment provides a software adaptability testing device, as Figure 7 shown, including:
[0216] An acquisition module 501, configured to acquire a software package corresponding to the target software;
[0217] A determination module 502, configured to identify the software package and determine the software package type corresponding to the software package;
[0218] A detection module 503, configured to detect whether the target software is adapted to the target system according to the software package type;
[0219] An output module 504, configured to output the reason for the mismatch if the target software is not adapted to the target system.
[0220] The further function descriptions of the above-mentioned various modules and units are the same as those in the corresponding above-mentioned embodiments, and will not be repeated here.
[0221] The software adaptability testing device in this embodiment is presented in the form of functional units. Here, the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and a memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0222] An embodiment of the present invention further provides an electronic device having the above Figure 7 shown software adaptability testing device.
[0223] Please refer to Figure 8 , Figure 8 which is a schematic structural diagram of an electronic device provided by an alternative embodiment of the present invention. As Figure 8 shown, the electronic device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including a high-speed interface and a low-speed interface. Each component communicates with each other using different buses and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed within the electronic device, including instructions stored in the memory 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 alternative 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 set of blade servers, or a multi-processor system). Figure 8 In
[0224] FIG. 14, one processor 10 is taken as an example.
[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. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the electronic device, etc. In addition, the memory 20 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some alternative embodiments, the memory 20 may optionally include a memory remotely disposed relative to the processor 10, and these remote memories can be connected to the electronic device through 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 volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, a hard disk, or a solid-state drive; the memory 20 may further 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 through a bus or other means. Figure 8 Taking connection through a bus as an example.
[0229] The input device 30 can receive input digital or character information, and generate key signal inputs related to the user settings and function controls of the electronic device, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointing stick, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (such as an LED), and a haptic feedback device (such as 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 alternative embodiments, the display device may be a touch screen.
[0230] Embodiments of the present invention also provide a computer-readable storage medium. The method according to the embodiments of the present invention can be implemented in hardware, firmware, or be implemented as computer code that can be recorded on a storage medium, or be implemented as computer code that is originally stored in a remote storage medium or a non-transitory machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, 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 memory, a random access memory, a flash memory, a hard disk, or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned 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 the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.
[0231] A part of the present invention can be applied as a computer program product, such as computer program instructions. When executed by a computer, through the operation of the computer, the method and / or technical solution according to the present invention can be invoked or provided. Those skilled in the art should understand that the forms of existence of computer program instructions in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are 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. Herein, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible by the computer.
[0232] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A software adaptability testing method, characterized in that The method includes: Obtain the software package corresponding to the target software; Identify the software package to determine the software package type corresponding to the software package; According to the software package type, detect whether the target software is compatible with the target system; If the target software is not compatible with the target system, output the reason for incompatibility; Among them, the software package type includes the rpm package type, and according to the software package type, detecting whether the target software is compatible with the target system includes; Parse the software package to determine at least one dependent rpm package on which the software package depends; Search for each of the dependent rpm packages in the target system; If all the dependent rpm packages are found in the target system, record each of the dependent rpm packages and put each of the dependent rpm packages into a preset database; Obtain the target function structure and target data structure in the dynamic library called by the program file in the target software; Based on the target function structure and the target data structure, detect whether the target software is compatible with the target system.
2. The method according to claim 1, characterized in that, The method further includes: If there is at least one of the dependent rpm packages not found in the target system, determine the dependent rpm package that cannot be found as a missing dependent rpm package and determine that the target software is not compatible; Correspondingly, the if the target software is not compatible with the target system, then output the reason for incompatibility, including; Based on the dependency relationship between the software package and each of the dependent rpm packages, label 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; Output the reason for incompatibility to the target user as the missing of each of the first missing dependent rpm packages.
3. The method according to claim 1, characterized in that, Among them, The software package type includes non-rpm package type, and according to the software package type, detecting whether the target software is compatible with the target system includes; Identify the software package to determine the installation directory corresponding to the software package; Traverse the installation directory and filter out at least one program file from it; Parse each of the program files to determine the dynamic libraries on which each of the program files depends; For each of the dynamic libraries, search for the dynamic library in the target system and the target repository corresponding to the target system; If all the dynamic libraries are found in the target system and / or the target repository, record each of the found dynamic libraries and put each of the found dynamic libraries into a preset database; Parse each of the program files to obtain the target function structure and target data structure in the dynamic library called by the program file in the target software; Based on the target function structure and the target data structure, detect whether the target software is compatible with the target system.
4. The method according to claim 3, wherein The method further includes: If there is at least one of the dynamic libraries not found in the target system and the target repository, determine the dynamic library that cannot be found as the first missing dynamic library and detect whether there is an rpm package providing the dynamic library file in the target repository; If there is an RPM package providing the dynamic library file in the target repository, make changes based on the RPM package providing the dynamic library file, generate each of the first missing dynamic libraries, record each of the first missing dynamic libraries, and put them into the preset database; If there is no RPM package providing the dynamic library file in the target repository, determine that the target system does not support the first missing dynamic library, and determine that the target software is not compatible with the target system; Correspondingly, if the target software is not compatible with the target system, output the incompatibility reasons, including: Based on the relationship between the software package and each program file, and the relationship between each program file and each dynamic library, label 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 on which the first missing dynamic library depends; Output to the target user that the reason for the incompatibility is the lack of the second missing dependency RPM package.
5. The method according to claim 1 or 3, characterized in that The detecting whether the target software is compatible with the target system based on the target function structure and the target data structure includes: Obtain the standard running environment corresponding to the target software; the standard running environment includes the version information of the standard running system corresponding to the target software; Obtain the first function structure data structure set corresponding to the standard running environment; Obtain the second function structure data structure set corresponding to the target system; Compare the first function structure data structure set with the second function structure data structure set to determine the differences of the second function structure data structure set relative to the second function structure data structure set; Generate an ABI difference database table based on the differences of the second function structure data structure set relative to the second function structure data structure set; Detect whether the target software is compatible with the target system based on the relationship between the ABI difference database table and the target function structure and the target data structure.
6. The method according to claim 5, wherein Wherein, The number of the target function structure and the target data structure is at least one, and the detecting whether the target software is compatible with 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 structure and each of the target data structure, search for the target function structure and / or the target data structure in the ABI difference database table; If all of the target function structure and / or the target data structure are not found in the ABI difference database table, determine that the target system supports all of the target function structure and / or the target data structure, that is, the target software is compatible with the target system.
7. The method according to claim 6, wherein The method further includes: 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 target data structure, and the target function structure and / or target data structure not supported by the target system are determined as the missing function structure and / or missing data structure; Correspondingly, if the target software is not compatible with the target system, the reasons for incompatibility are output, including: Based on the relationships between the software package and each program file, between each program file and each dynamic library, and 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; Determine the second missing dynamic library corresponding to the missing function structure and / or the missing data structure; Determine the third missing dependent rpm package corresponding to the second missing dynamic library; Output the reason for incompatibility as the missing third missing dependent rpm package.
8. A software adaptability testing device, characterized in that, The device includes: An acquisition module, configured to acquire a software package corresponding to the target software; A determination module, configured to identify the software package and determine the software package type corresponding to the software package; A detection module, configured to detect whether the target software is compatible with the target system according to the software package type; wherein, the software package type includes the rpm package type, and detecting whether the target software is compatible with the target system according to the software package type includes: parsing the software package to determine at least one dependent rpm package on which the software package depends; searching for each of the dependent rpm packages in the target system; if all the dependent rpm packages are found in the target system, recording each of the dependent rpm packages and putting each of the dependent rpm packages into a preset database; acquiring the target function structure and target data structure in the dynamic library called by the program file in the target software; and detecting whether the target software is compatible with the target system based on the target function structure and the target data structure; An output module, configured to output the reason for incompatibility if the target software is not compatible with the target system.
9. An electronic device, characterized in that, It includes: A memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to execute the software compatibility test method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Computer instructions are stored on the computer-readable storage medium, and the computer instructions are used to cause the computer to execute the software compatibility test method according to any one of claims 1 to 7.
11. A computer program product, characterized in that, It includes computer instructions, and the computer instructions are used to cause the computer to execute the software compatibility test method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Industrial software compatibility testing method under multiple localization platforms
CN113918452A