Compatibility analysis method and related device

By comparing the file information tuples of RPM packages and their lower version packages, identifying compatibility issues, solving the problem of compatibility changes caused by software package upgrades, realizing automated compatibility analysis and improving version research and development efficiency.

CN120029662APending Publication Date: 2025-05-23TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311581738.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-23
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

In a package management system, package upgrades lead to compatibility changes, which may cause dependent software packages to be unavailable, and may even cause application software to crash, making it difficult to effectively manage and identify compatibility issues.

Method used

Provides a compatibility analysis method, by obtaining the file information tuples of the RPM package to be checked and its lower version package, comparing file information tuples, identifying function symbol deletion and change in the number of function parameters, dividing compatibility levels, and determining package incompatibility when the level exceeds the preset level.

Benefits of technology

It realizes automatic checking of software package changes, timely identifying software package compatibility issues, greatly improving version research and development efficiency, and avoiding application crashes caused by compatibility issues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120029662A_ABST
    Figure CN120029662A_ABST
Patent Text Reader

Abstract

The invention discloses a compatibility analysis method and a related device, which are applied to the technical field of cloud. According to the method provided by the invention, after the to-be-detected first RPM package is downloaded on the cloud platform, the second RPM package lower in version than the first RPM package is matched, the information of the first RPM package and the information of the second RPM package are acquired to construct the corresponding file information tuple, and the file information tuple corresponding to the first RPM package and the file information tuple corresponding to the second RPM package are compared, so that the detection result of the first RPM package and the second RPM package is obtained. When the file information tuple corresponding to the first RPM package is subjected to function symbol deletion compared with the file information tuple of the second RPM package, it can be determined that the first RPM package is incompatible, and when the number of function parameters of the file information tuple corresponding to the first RPM package is changed compared with the number of function parameters of the file information tuple of the second RPM package, compatibility levels are divided according to the change condition, and therefore the compatibility of the first RPM package is improved. When the compatibility level exceeds a preset level, it can be determined that the first RPM packet is incompatible. Through the mode, the change of the software package is automatically checked, the compatibility of the software package is identified in time, and the version research and development efficiency is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing, and in particular to a compatibility analysis method and related devices. Background Art

[0002] Red Hat Package Manager (RPM) was proposed by Red Hat and adopted by many embedded (Linux) distributions. It has a unified file database that can record detailed changes in software package installation, uninstallation, and upgrades, and automatically analyze software package dependencies. Self-developed versions need to build Python packages required by the basic system and Python capabilities required to meet typical business needs, and these RPM packages developed using Python are constantly evolving and updating upstream.

[0003] Currently, distribution vendors need to follow the upstream and synchronize updates to their own distributions as needed. However, since a large number of Python packages are involved, and there are certain dependencies between packages, and they will call each other's interfaces, if the package upgrade causes a change in compatibility, it is likely to cause a dependent software package to become unavailable, or even directly cause the application software to crash. Summary of the invention

[0004] The embodiments of the present application provide a compatibility analysis method and related devices for automatically checking software package changes and timely identifying the compatibility of software packages, thereby greatly improving version development efficiency.

[0005] In view of this, the present application provides a compatibility analysis method, including:

[0006] Get the first RPM package to be checked;

[0007] Match the second RPM package corresponding to the first RPM package, where the version of the second RPM package is lower than that of the first RPM package;

[0008] Obtain the file information tuples of the first RPM package and the second RPM package, and compare them;

[0009] When a function symbol is deleted in the file information tuple, it is determined that the first RPM package is incompatible;

[0010] When the number of function parameters in the file information tuple changes, the compatibility level is divided according to the change in the number of function parameters;

[0011] When the compatibility level exceeds a preset level, it is determined that the first RPM package is incompatible.

[0012] On the other hand, the present application provides a compatibility analysis device, comprising:

[0013] An acquiring unit, used for acquiring a first RPM package to be checked;

[0014] A matching unit, configured to match a second RPM package corresponding to the first RPM package, wherein a version of the second RPM package is lower than a version of the first RPM package;

[0015] A comparison unit, used for obtaining the file information tuple of the first RPM package and the second RPM package, and comparing them;

[0016] A determination unit is used to determine that the first RPM package is incompatible when a function symbol is deleted in the file information tuple; when the number of function parameters changes in the file information tuple, divide the compatibility level according to the change in the number of function parameters; when the compatibility level exceeds a preset level, determine that the first RPM package is incompatible.

[0017] In a possible design, in another implementation of another aspect of the embodiment of the present application, the comparison unit is specifically used to:

[0018] Determine the python file from the first RPM package and the second RPM package based on the file name suffix;

[0019] The configuration information in the python file is taken out and stored in the file information tuples of the first RPM package and the second RPM package, and then compared.

[0020] In a possible design, in another implementation of another aspect of the embodiment of the present application, the function parameters include mandatory parameters and optional parameters; and the determining unit is specifically used to:

[0021] When the number of mandatory parameters in the file information tuple increases, the compatibility level of the first RPM package exceeds a preset level;

[0022] When the sum of the numbers of required parameters and optional parameters in the file information tuple decreases, the compatibility level of the first RPM package exceeds a preset level.

[0023] In a possible design, in another implementation of another aspect of the embodiment of the present application, the device further includes a display unit, and the display unit is specifically used to:

[0024] Show deleted function symbols;

[0025] Shows the changed function parameters and the corresponding compatibility level.

[0026] In a possible design, in another implementation of another aspect of the embodiment of the present application, the device further includes a display unit, and the display unit is specifically used to:

[0027] When a new function symbol appears in the file information tuple, the new function symbol is displayed.

[0028] In a possible design, in another implementation of another aspect of the embodiment of the present application, the device further includes a trigger unit, and the trigger unit is specifically used to:

[0029] In response to the trigger instruction, the acquisition unit is triggered according to the trigger instruction.

[0030] Another aspect of the present application provides a computer device, comprising:

[0031] memories, transceivers, processors, and bus systems;

[0032] Wherein, the memory is used to store programs;

[0033] The processor is used to execute the program in the memory, including executing the above-mentioned methods;

[0034] The bus system is used to connect the memory and the processor so that the memory and the processor can communicate with each other.

[0035] Another aspect of the present application provides a computer-readable storage medium, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer is enabled to execute the above-mentioned methods.

[0036] Another aspect of the present application provides a computer program product or a computer program, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided by the above aspects.

[0037] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0038] The embodiment of the present application matches the second RPM package of a lower version than the first RPM package to be checked, obtains the information of the first RPM package and the second RPM package to construct a corresponding file information tuple, and compares the file information tuples corresponding to the first RPM package and the second RPM package. When the file information tuple corresponding to the first RPM package is compared with the file information tuple of the second RPM package, the first RPM package can be determined to be incompatible. When the number of function parameters in the file information tuple corresponding to the first RPM package is changed compared with the file information tuple of the second RPM package, the compatibility level is divided according to the change. When the compatibility level exceeds the preset level, it can be determined that the first RPM package is incompatible. In the above manner, the software package changes are automatically checked, the compatibility of the software package is timely identified, and the efficiency of version development is greatly improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a schematic diagram of the architecture of the update system in the embodiment of the present application;

[0040] Figure 2 A flow chart of a compatibility analysis method in an embodiment of the present application;

[0041] Figure 3 A compatibility analysis timing diagram in an embodiment of the present application;

[0042] Figure 4 A schematic diagram of parameter quantity changes in an embodiment of the present application;

[0043] Figure 5 This is another schematic diagram of parameter quantity changes in an embodiment of the present application;

[0044] Figure 6 This is another schematic diagram of parameter quantity changes in an embodiment of the present application;

[0045] Figure 7 This is another schematic diagram of parameter quantity changes in an embodiment of the present application;

[0046] Figure 8 This is another schematic diagram of parameter quantity changes in an embodiment of the present application;

[0047] Fig. 9 This is another schematic diagram of parameter quantity changes in an embodiment of the present application;

[0048] Fig.10 A schematic diagram of the flow of the compatibility analysis solution in the embodiment of the present application;

[0049] Fig.11 This is a schematic diagram showing a change in an embodiment of the present application;

[0050] Fig.12 This is another schematic diagram showing another change in the embodiment of the present application;

[0051] Fig.13 This is a schematic diagram of newly added files in the embodiment of this application;

[0052] Fig.14 A schematic diagram of the structure of a compatibility analysis device in an embodiment of the present application;

[0053] Fig.15 A schematic diagram of the structure of a computer device in an embodiment of the present application. DETAILED DESCRIPTION

[0054] The embodiments of the present application provide a compatibility analysis method and related devices for automatically checking software package changes and timely identifying the compatibility of software packages, thereby greatly improving version development efficiency.

[0055] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "corresponding to" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0056] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0057] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0058] In addition, in order to better illustrate the present application, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present application can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present application.

[0059] Red Hat Package Manager (RPM) was proposed by Red Hat and adopted by many embedded (Linux) distributions. It has a unified file database that can record detailed changes in software package installation, uninstallation, upgrades, and other information, and automatically analyze software package dependencies. Self-developed distributions need to build Python packages required by the basic system and Python capabilities required to meet typical business needs, and these RPM packages developed using Python are constantly evolving and updating to the cloud platform. Currently, as a distribution vendor, it is necessary to follow the updates of the cloud platform and synchronize the updates to its own distribution according to needs. However, since a large number of Python packages are involved, and there are certain dependencies between packages, they will call each other's interfaces. If the package upgrade causes a change in compatibility, it is likely to cause a software package that depends on it to be unavailable, or even directly cause the application software to crash.

[0060] Based on this, the embodiment of the present application provides a compatibility analysis method, matching a second RPM package of a lower version than the first RPM package to be checked, obtaining information of the first RPM package and the second RPM package to construct a corresponding file information tuple, and comparing the file information tuples corresponding to the first RPM package and the second RPM package. When the file information tuple corresponding to the first RPM package is compared with the file information tuple of the second RPM package, the first RPM package can be determined to be incompatible. When the number of function parameters in the file information tuple corresponding to the first RPM package is changed compared with the file information tuple of the second RPM package, the compatibility level is divided according to the change. When the compatibility level exceeds the preset level, it can be determined that the first RPM package is incompatible. Through the above method, the software package changes are automatically checked, the compatibility of the software package is timely identified, and the efficiency of version development is greatly improved.

[0061] In the embodiment of the present application, the RPM package used for updating can be obtained from the cloud platform, and the cloud platform stores corresponding software package update resources based on cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network in a wide area network or a local area network to realize the calculation, storage, processing, and sharing of data. It is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the application of cloud computing business model, which can form a resource pool, which is used on demand and flexible and convenient. Cloud computing technology will become an important support. The background service of the technical network system requires a large amount of computing and storage resources, such as video websites, picture websites, and more portal websites. With the high development and application of the Internet industry, each item may have its own identification mark in the future, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately, and all kinds of industry data need strong system backing support, which can only be achieved through cloud computing.

[0062] The compatibility analysis cloud method provided in the embodiment of the present application can be implemented by various electronic devices, for example, it can be implemented by a terminal device alone, or it can be implemented by a server and a terminal device in collaboration. For example, the terminal device performs the compatibility analysis method described below alone, or the terminal device and the server perform the compatibility analysis method described below in collaboration, for example, the server stores update resources, such as updated RPM packages, and the terminal device can download the required update resources from the server, such as downloading the first RPM package. After downloading the first RPM package, the second RPM package of the lower version of the first RPM package can be matched, and the second RPM package is the data package currently loaded and used, and the files in the first RPM package and the second RPM package are found, and file information tuples are constructed for the first RPM package and the second RPM package respectively, and then the file information tuples of the two packages are compared. If the file information tuple of the first RPM package is compared with the file information tuple of the second RPM package, the first RPM package can be directly determined to be incompatible, or when the number of function parameters in the file information tuple of the first RPM package is changed compared with the file information tuple of the second RPM package, the compatibility level is divided according to the change situation, and when the compatibility level exceeds the preset level, the first RPM package is determined to be incompatible.

[0063] The electronic device for compatibility analysis provided in the embodiments of the present application may be various types of terminal devices or servers, wherein the server may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the terminal may be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited thereto. The terminal device and the server may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.

[0064] Taking the server as an example, it can be a server cluster deployed in the cloud, opening artificial intelligence cloud services (AIaaS, AI as a Service) to objects. The AIaaS platform will split several common AI services and provide independent or packaged services in the cloud. This service model is similar to an AI theme mall. All objects can access one or more artificial intelligence services provided by the AIaaS platform through an application programming interface.

[0065] For example, one of the artificial intelligence cloud services may be a compatibility analysis service, that is, a server in the cloud is encapsulated with a compatibility analysis program provided by an embodiment of the present application. The terminal device responds to the object's compatibility analysis operation on the new RPM package by calling the compatibility analysis service in the cloud service, so that the server deployed in the cloud calls the encapsulated compatibility analysis program, obtains the old RPM package of the lower version, compares the file information tuple, and determines that the new RPM package is incompatible when the compatibility level of function symbol deletion or function parameter number change exceeds the preset level.

[0066] The following is an example of an article recall method provided by an embodiment of the present application being implemented in collaboration between a server and a terminal. Figure 1 , Figure 1 The terminal device 11 is connected to the server 13 via the network 12, and the network 12 can be a wide area network or a local area network, or a combination of the two.

[0067] In some embodiments, the object can view the update resources of the server 13 through the terminal device 11, and download the required first RPM package from the server 13, and then match the lower version of the second RPM package, compare the file information tuples of the two packages, and when the compatibility level of function symbol deletion or change in the number of function parameters exceeds a preset level, determine that the new RPM package is incompatible.

[0068] The compatibility analysis method provided in the embodiment of the present application will be described below in conjunction with the accompanying drawings. The executor of the following compatibility analysis method takes the terminal device as an example, and can be specifically implemented by the terminal device by running the various computer programs mentioned above; of course, based on the understanding of the following text, it is not difficult to see that the compatibility method provided in the embodiment of the present application can also be implemented collaboratively by the terminal device and the server.

[0069] See also Figure 2 , Figure 2 The figure is a flow chart of a compatibility analysis method provided in an embodiment of the present application, the method comprising:

[0070] Step 201: Get the first RPM package to be checked.

[0071] In one or more embodiments, the first RPM package is a software package for updating, and the first RPM package may be obtained by directly inputting the object, or by connecting the object to the cloud platform through a terminal device and downloading it from the cloud platform.

[0072] Step 202: Match the second RPM package corresponding to the first RPM package, where the version of the second RPM package is lower than that of the first RPM package.

[0073] In one or more embodiments, the current first RPM package is the latest version of the software package, that is, the software package currently loaded and used is lower than the version of the first RPM package. The embodiment of the present application can obtain the second RPM package of the lower version corresponding to the first RPM package, that is, the second RPM package is a different version of the same data package of the first RPM package. Among them, the second RPM package can also be directly input into the binary RPM package by the object, or the object can input two directories, and the terminal device matches two RPM packages of different versions according to the directories. Exemplarily, for the first RPM package to be obtained, the name of the lower version RPM package can be obtained through rpm-q --queryformat "%{NAME}".

[0074] Step 203: Obtain the file information tuples of the first RPM package and the second RPM package, and compare them.

[0075] In one or more embodiments, file information tuples can be constructed for the first RPM package and the second RPM package respectively, that is, the file information of the first RPM package is extracted and stored in a tuple to form a file information tuple corresponding to the first RPM package, and the file information of the second RPM package is extracted and stored in a tuple to construct a file information tuple corresponding to the second RPM package. The file information tuple corresponding to the first RPM package can then be compared with the file information tuple corresponding to the second RPM package to obtain changes in the file information.

[0076] Step 204: When a function symbol is deleted in the file information tuple, it is determined that the first RPM package is incompatible.

[0077] In one or more embodiments, for the comparison result of the file information tuple corresponding to the first RPM package and the file information tuple corresponding to the second RPM package, if the file information tuple corresponding to the first RPM package is missing function symbols compared to the file information tuple corresponding to the second RPM package, that is, some function symbols are in the second RPM package but not in the updated first RPM package, for the dependent software package that depends on the second RPM package and needs to be connected to the function symbols, after the second RPM package is updated to the first RPM package, the dependent software package cannot continue to connect to the function symbols, resulting in unavailability. At this time, the first RPM package is not compatible with the dependent package of the second RPM package.

[0078] Step 205: When the number of function parameters in the file information tuple changes, the compatibility level is divided according to the change in the number of function parameters.

[0079] In one or more embodiments, if the file information tuple corresponding to the first RPM package does not have a deletion of the function symbol compared to the file information tuple corresponding to the second RPM package, it is also possible to check whether the number of function parameters has changed, and to determine whether the change in the number of function parameters affects the docking of the dependent software package. The embodiment of the present application can divide the compatibility level according to the change in the number of function parameters, and the compatibility level can be the degree of impact on the dependent software package, that is, whether the parameters used by the function call after the update affect the parameters used by the function call before the update.

[0080] Step 206: When the compatibility level exceeds a preset level, determine that the first RPM package is incompatible.

[0081] In one or more embodiments, a preset level can be set for the compatibility level. The first RPM package corresponding to a compatibility level greater than or equal to the preset level has a greater impact on the dependent software package of the second RPM package, which will affect the use of the dependent software package, that is, it is confirmed that the first RPM package is incompatible with the dependent software package.

[0082] For example, the compatibility analysis sequence diagram of the embodiment of the present application can refer to Figure 3As shown, step 301.rpm-check calls the py_check tool as the tool entry to check the python package (run()). Step 302.py_check tool matches the python file from the given RPM package through find_python_files(). Step 303.py_check tool obtains function symbols and function parameters through the AST tree through get_interface_functions(). Step 304.py_check tool obtains the difference in function symbols and function parameters between the low version and the high version through get_file_change(). Step 305.py_check tool evaluates the compatibility level based on the obtained differences through calculate_compat_level(). Step 306.py_check tool returns the result of the level evaluation to rpm-check (return()).

[0083] The embodiment of the present application matches the second RPM package of a lower version than the first RPM package to be checked, obtains the information of the first RPM package and the second RPM package to construct a corresponding file information tuple, and compares the file information tuples corresponding to the first RPM package and the second RPM package. When the function symbol is deleted in the file information tuple corresponding to the first RPM package compared with the file information tuple of the second RPM package, it can be determined that the first RPM package is incompatible. When the number of function parameters in the file information tuple corresponding to the first RPM package changes compared with the file information tuple of the second RPM package, the compatibility level is divided according to the change. When the compatibility level exceeds the preset level, it can be determined that the first RPM package is incompatible. In the above manner, the function symbol and the number of function parameters in the file information tuple of the low-version software package are automatically obtained to compare, the software package change can be checked, the compatibility of the software package can be identified in time, and the efficiency of version development is greatly improved.

[0084] Optionally, in the above Figure 2 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, obtaining the file information tuple of the first RPM package and the second RPM package and comparing them includes:

[0085] Determine the python file from the first RPM package and the second RPM package based on the file name suffix;

[0086] The configuration information in the python file is taken out and stored in the file information tuples of the first RPM package and the second RPM package, and then compared.

[0087] In one or more embodiments, a method for obtaining a file information tuple is introduced. First, the python file in the RPM package is extracted. The extraction method can be based on the file type and file suffix, etc., to respectively extract the python file in the first RPM package and the python file in the second RPM package, then extract the function symbols and function parameters in the python file, and construct the file information tuple corresponding to the first RPM package with the function symbols and function parameters extracted from the python file in the first RPM package, and construct the file information tuple corresponding to the second RPM package with the function symbols and function parameters extracted from the python file in the second RPM package, and then compare the file information tuples of the two packages.

[0088] Exemplarily, function symbols are only examples. Classes, function symbols, global variables, and parameters in each Python file can also be extracted. The specific extraction method can be to construct a file tree for the Python file through the abstract syntax trees (AST) module, and then recursively extract ast.FunctionDef, ast.ClassDef, ast.Assign, and node.args, and store them in a tuple.

[0089] Secondly, in the embodiment of the present application, a method for obtaining a file information tuple is provided. Through the above method, the Python file in the RPM package is determined according to the suffix, and then the function symbol and function parameter are extracted from the Python file to construct a file information tuple for comparison, so that the functions of the Python files before and after the update can be accurately extracted for comparison, thereby improving the accuracy of the comparison result.

[0090] Optionally, in the above Figure 2 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, the function parameters include mandatory parameters and optional parameters;

[0091] When the number of function parameters in the file information tuple changes, the compatibility level is divided according to the change in the number of function parameters:

[0092] When the number of mandatory parameters in the file information tuple increases, the compatibility level of the first RPM package exceeds a preset level;

[0093] When the sum of the numbers of required parameters and optional parameters in the file information tuple decreases, the compatibility level of the first RPM package exceeds a preset level.

[0094] In one or more embodiments, a method of dividing compatibility levels is introduced. Function parameters include optional parameters and mandatory parameters. Mandatory parameters are parameters that need to be used at least, and optional parameters are parameters that can be used selectively. The number of mandatory parameters of the second RPM package before the update is the number of parameters that the second RPM package needs to call at least, which can be called the minimum number of parameters. The sum of the number of mandatory parameters plus the number of optional parameters of the second RPM package before the update is the number of parameters that the second RPM package can call at most, which can be called the maximum number of parameters. If the number of mandatory parameters of the first RPM package after the update increases compared to the minimum number of parameters, when the second RPM package only needs to call the minimum number of parameters, some of the mandatory parameters in the first RPM package are still not called, resulting in an error message due to insufficient number of parameters received by the function after the change, and the first RPM package is incompatible. If the sum of the number of mandatory parameters and optional parameters of the first RPM package is less than the maximum number of parameters, when the second RPM package needs to call the maximum number of parameters, some parameter calls are missing in the first RPM package, resulting in an error message, and the first RPM package is incompatible.

[0095] Exemplarily, the function parameter change compatibility level is specifically classified into the following situations, wherein a low severity level indicates that the first RPM package is compatible, and a medium or high severity level indicates that the first RPM package is incompatible.

[0096] See also Figure 4 A schematic diagram of parameter quantity change is shown in FIG. Figure 4 In the example, FuncA represents the function parameters of the second RPM package, and FuncB represents the function parameters of the first RPM package. The number of required parameters of FuncA is greater than the number of required parameters of FuncB, and the sum of the number of required parameters and optional parameters of FuncA is less than the sum of the number of required parameters and optional parameters of FuncB. After the change, no matter how many parameters are in the calling function before the change, they will not exceed the maximum number of parameters or be less than the minimum number of parameters, so this update will not cause compatibility changes, and the severity is low.

[0097] See also Figure 5 Another schematic diagram of parameter quantity changes is shown in FIG. Figure 5 In the example, FuncA represents the function parameters of the second RPM package, and FuncB represents the function parameters of the first RPM package. The number of required parameters of FuncA is less than the number of required parameters of FuncB, and the sum of the number of required and optional parameters of FuncA is less than the sum of the number of required and optional parameters of FuncB. If the calling function only passes the minimum number of parameters (i.e., required parameters) before the change, the function will report an error after the change because the number of received parameters is insufficient. If the number of parameters passed by the calling function is greater than the required parameters after the change, no problem will occur, that is, this change may cause compatibility issues with a medium severity.

[0098] See also Figure 6 Another schematic diagram of parameter quantity changes is shown in Figure 1. Figure 6 In the example, FuncA represents the function parameters of the second RPM package, and FuncB represents the function parameters of the first RPM package. The number of required parameters of FuncA is less than the number of required parameters of FuncB, and the sum of the number of required parameters and optional parameters of FuncA is less than the number of required parameters of FuncB. If only the minimum number of parameters (i.e., required parameters) are passed to the function call before the change, the function will report an error due to insufficient number of parameters after the change. Even if the number of calls before the change is increased to the maximum number of parameters, the function will still report an error due to insufficient number of parameters after the change. That is, the parameters passed to the function call before the change cannot meet the requirements for passing parameters after the change. This change will definitely cause compatibility issues with a high severity level.

[0099] See also Figure 7 Another schematic diagram of parameter quantity changes is shown in FIG. Figure 7 In the example, FuncA represents the function parameters of the second RPM package, and FuncB represents the function parameters of the first RPM package. The number of required parameters of FuncA is the same as that of FuncB, and the sum of the number of required and optional parameters of FuncA is less than the sum of the number of required and optional parameters of FuncB. If the function was called before the change and only the minimum number of parameters (i.e., required parameters) was passed, the optional number of the function is consistent after the change, and the parameters can be received normally. Even if the number of calls before the change is increased to the maximum number of parameters, it will not exceed the maximum number of parameters or be less than the minimum number of parameters. Therefore, this update will not cause compatibility changes, and the severity is low.

[0100] See also Figure 8 Another schematic diagram of parameter quantity changes is shown in Figure 1. Figure 8 In the example, FuncA represents the function parameters of the second RPM package, and FuncB represents the function parameters of the first RPM package. The number of required parameters of FuncA is greater than the sum of the number of required parameters and optional parameters of FuncB. The minimum number of input parameters before the change is greater than the maximum number of input parameters after the change. This change will definitely cause compatibility issues, and the severity is high.

[0101] See also Fig. 9 Another schematic diagram of parameter quantity changes is shown in FIG. Fig. 9In the example, FuncA represents the function parameters of the second RPM package, and FuncB represents the function parameters of the first RPM package. The number of required parameters of FuncA is greater than the number of required parameters of FuncB, but less than the sum of the number of required parameters and optional parameters of FuncB, and the sum of the number of required parameters and optional parameters of FuncA is greater than the sum of the number of required parameters and optional parameters of FuncB. If only the minimum number of parameters (i.e., required parameters) are passed when calling the function before the change, the required parameters and some optional parameters after the change can be called, that is, normal operation. If the maximum number of parameters is passed when calling the function before the change, an error will be reported that the number of parameters after the change is exceeded, that is, the severity is medium.

[0102] The compatibility analysis solution of the embodiment of the present application can refer to Fig.10 As shown, step 1001. Input the first RPM package to be checked; step 1002. Match the first RPM package with the second RPM package of the lower version; step 1003. Take out the files in the RPM package to build a file information tuple, take out the classes, function symbols, global variables, and parameters in each python file, and store them in the file information tuple; step 1004. Compare the file information tuple to determine whether there is a deleted function, if yes, execute step 1008, otherwise execute step 1005; step 1005. Compare the file information tuple to determine the change in the number of function parameters, and perform a compatibility level assessment. The addition of classes, function symbols, and global variables are all classified as Low level, that is, they have no impact on compatibility, and the deletion of classes, function symbols, and global variables is classified as High level, that is, they must have an impact on compatibility. The changes in the number and type of parameters are evaluated at different levels according to the following compatibility assessment method. (Note: changes in Python internal functions are classified as Low level and will not affect compatibility); Step 1006. Determine whether the compatibility level is medium or high, if so, execute step 1008, otherwise execute step 1007; Step 1007, determine that the first RPM package is compatible; Step 1008. Determine that the first RPM package is incompatible.

[0103] Secondly, in the embodiment of the present application, a method for dividing compatibility levels is provided. By dividing the compatibility levels based on the change in the number of required parameters and optional parameters, it is possible to intuitively determine whether they are compatible, thereby improving the accuracy of dividing the compatibility levels.

[0104] Optionally, in the above Figure 2 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, the method further includes:

[0105] Show deleted function symbols;

[0106] Shows the changed function parameters and the corresponding compatibility level.

[0107] In one or more embodiments, a method of displaying compatibility levels is introduced. For deleted function symbols, they can be directly displayed on the display interface to provide objects for viewing. For the changed number of function parameters, the function parameter changes and the compatibility level corresponding to the changes can also be prompted accordingly. In the embodiment of the present application, the function indication can be displayed in a divided area on the display interface as a function with a changed number of functions, and the corresponding severity can be displayed.

[0108] For example, see Fig.11 A schematic diagram showing a change is shown in FIG. Fig.11 The file (file), the removed functions (removed functions) and the changed functions (changed functions) in the RPM package are displayed in the figure. The files can be taken as file 1.py, file 2.py, file 3.py and file 4.py. Among them, file 1.py deletes functions 1, 2 and 3, file 4.py deletes functions 4, 5 and 6, and file 2.py has function parameter changes, including functions 7, 8 and 9. The severity of function 7 is high, the severity of function 8 is low, and the severity of function 9 is medium. File 3.py has function parameter changes, including function 10, and the severity of function 10 is low. The display interface can also directly display the changes in the number of function parameters, which is not limited here.

[0109] Secondly, in the embodiment of the present application, a method for displaying the compatibility level is provided. Through the above method, the deletion function symbol and the change function parameter number of the file, i.e., the corresponding compatibility level, are directly displayed on the display interface, and the impact on compatibility and the impact level can be evaluated according to the change items, which improves the developer's ability to evaluate the software package changes intuitively and easily.

[0110] Optionally, in the above Figure 2 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, the method further includes:

[0111] When a new function symbol appears in the file information tuple, the new function symbol is displayed.

[0112] In one or more embodiments, a method of displaying newly added function symbols is introduced. The newly added function symbols can also be displayed to developers in a display interface accordingly, wherein the newly added functions do not affect the compatibility of the RPM package, but can provide change details for the object, which is convenient for developers to evaluate the software package.

[0113] For example, see Fig.12Another change diagram shown in FIG. Fig.11 On the basis of the above, a column of added functions is added. Taking file 2 as an example, file 2.py adds functions 11 and 12.

[0114] The addition or reduction of the entire Python file can also be displayed directly on the display interface. For example, taking the addition of a file as an example, see Fig.13 , the schematic diagram of the newly added files shown, Fig.13 The new files in the second RPM package are shown in the figure. The new files can be the first file.py and the second file.py as examples. Fig.13 The file address is shown in the figure, for example, user / firstfile.py, user / secondfile.py.

[0115] Secondly, in the embodiment of the present application, a method for displaying newly added function symbols is provided. Through the above method, the newly added function symbols are displayed synchronously, and the changed items can be checked and displayed, thereby improving the system availability.

[0116] Optionally, in the above Figure 2 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, the method further includes:

[0117] In response to the trigger instruction, the step of obtaining the first RPM package to be checked is triggered according to the trigger instruction.

[0118] In one or more embodiments, a method for triggering compatibility analysis is introduced. It is not necessary to perform compatibility analysis on the first RPM package in real time. In the embodiment of the present application, a button can be set, and the object clicks the case to generate a trigger instruction to instruct the terminal device to perform a compatibility analysis operation, that is, trigger step 201. A time interval can also be set or a trigger instruction can be generated adaptively, which is not limited here.

[0119] Secondly, in the embodiment of the present application, a method for triggering compatibility analysis is provided. Through the above method, the compatibility analysis operation of the software package is performed only when a trigger instruction is obtained, which can save computing resources.

[0120] The following is a detailed description of the compatibility analysis device in this application. Fig.14 , Fig.14 This is a schematic diagram of an embodiment of a compatibility analysis device in an embodiment of the present application. The compatibility analysis device 1400 includes:

[0121] The acquiring unit 1401 is used to acquire a first RPM package to be checked;

[0122] A matching unit 1402 is used to match a second RPM package corresponding to the first RPM package, where the version of the second RPM package is lower than that of the first RPM package;

[0123] A comparison unit 1403 is used to obtain the file information tuple of the first RPM package and the second RPM package, and compare them;

[0124] Determination unit 1404 is used to determine that the first RPM package is incompatible when a function symbol is deleted in the file information tuple; when the number of function parameters changes in the file information tuple, divide the compatibility level according to the change in the number of function parameters; when the compatibility level exceeds a preset level, determine that the first RPM package is incompatible.

[0125] In an embodiment of the present application, a compatibility analysis device is provided. Through the above device, the function symbols and function parameter numbers in the lower version software package comparison file information tuple are automatically obtained, the software package changes can be checked, and the compatibility of the software package can be identified in time, which greatly improves the efficiency of version development.

[0126] Optionally, in the above Fig.14 On the basis of the corresponding embodiment, in another embodiment of the article recall device 140 provided in the embodiment of the present application, the comparison unit 1403 is specifically used for:

[0127] Determine the python file from the first RPM package and the second RPM package based on the file name suffix;

[0128] The configuration information in the python file is taken out and stored in the file information tuples of the first RPM package and the second RPM package, and then compared.

[0129] In an embodiment of the present application, a compatibility analysis device is provided. Through the above device, the Python file in the RPM package is determined according to the suffix, and then the function symbol and function parameter are extracted from the Python file to construct a file information tuple for comparison, so that the functions of the Python files before and after the update can be accurately extracted for comparison, thereby improving the accuracy of the comparison result.

[0130] Optionally, in the above Fig.14 On the basis of the corresponding embodiment, in another embodiment of the article recall device 140 provided in the embodiment of the present application, the function parameters include mandatory parameters and optional parameters; the determination unit 1404 is specifically used for:

[0131] When the number of mandatory parameters in the file information tuple increases, the compatibility level of the first RPM package exceeds a preset level;

[0132] When the sum of the numbers of required parameters and optional parameters in the file information tuple decreases, the compatibility level of the first RPM package exceeds a preset level.

[0133] In an embodiment of the present application, a compatibility analysis device is provided. By dividing the compatibility level based on the change in the number of mandatory parameters and optional parameters, the compatibility can be determined intuitively, thereby improving the accuracy of the division of the compatibility level.

[0134] Optionally, in the above Fig.14 On the basis of the corresponding embodiment, in another embodiment of the article recall device 140 provided in the embodiment of the present application, the device 140 further includes a display unit 1405, and the display unit 1405 is specifically used for:

[0135] Show deleted function symbols;

[0136] Shows the changed function parameters and the corresponding compatibility level.

[0137] In an embodiment of the present application, a compatibility analysis device is provided. Through the above device, the deleted function symbol and the changed function parameter number of the file, i.e., the corresponding compatibility level, are directly displayed on the display interface, and the impact on compatibility and the impact level can be evaluated according to the changed items, which improves the developer's ability to evaluate the software package changes in an intuitive and easy-to-read manner.

[0138] Optionally, in the above Fig.14 On the basis of the corresponding embodiment, in another embodiment of the article recall device 140 provided in the embodiment of the present application, the device 140 further includes a display unit 1405, and the display unit 1405 is specifically used for:

[0139] When a new function symbol appears in the file information tuple, the new function symbol is displayed.

[0140] In an embodiment of the present application, a compatibility analysis device is provided. Through the above device, newly added function symbols are displayed synchronously, and the changed items can be checked and displayed, thereby improving system availability.

[0141] Optionally, in the above Fig.14 On the basis of the corresponding embodiment, in another embodiment of the article recall device 140 provided in the embodiment of the present application, the device 140 further includes a trigger unit 1406, and the trigger unit 1406 is specifically used for:

[0142] In response to the trigger instruction, the acquisition unit 1401 is triggered according to the trigger instruction.

[0143] In an embodiment of the present application, a compatibility analysis device is provided. By means of the device, the compatibility analysis operation of the software package is performed only when a trigger instruction is obtained, thereby saving computing resources.

[0144] Fig.15 3 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device 300 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 322 (for example, one or more processors) and memory 332, and one or more storage media 330 (for example, one or more mass storage devices) storing application programs 342 or data 344. Among them, the memory 332 and the storage medium 330 can be short-term storage or permanent storage. The program stored in the storage medium 330 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the computer device. Furthermore, the central processing unit 322 can be configured to communicate with the storage medium 330 to execute a series of instruction operations in the storage medium 330 on the computer device 300.

[0145] The computer device 300 may also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input and output interfaces 358, and / or one or more operating systems 341, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0146] The steps performed by the terminal device in the above embodiment can be based on the Fig.10 The computer device structure shown.

[0147] A computer-readable storage medium is also provided in an embodiment of the present application, on which a computer program is stored. When the computer program is executed by a processor, the steps of the methods described in the above embodiments are implemented.

[0148] A computer program product is also provided in an embodiment of the present application, including a computer program, which, when executed by a processor, implements the steps of the methods described in the above embodiments.

[0149] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0150] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0151] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0152] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0153] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0154] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A compatibility analysis method, It is characterized in that include: Get the first Red Hat Package Manager RPM package to be checked; Matching a second RPM package corresponding to the first RPM package, where the version of the second RPM package is lower than that of the first RPM package; Obtaining file information tuples of the first RPM package and the second RPM package, and comparing them; When a function symbol is deleted in the file information tuple, determining that the first RPM package is incompatible; When the number of function parameters in the file information tuple changes, the compatibility level is divided according to the change in the number of function parameters; When the compatibility level exceeds a preset level, it is determined that the first RPM package is incompatible.

2. The method according to claim 1, It is characterized in that The obtaining of the file information tuples of the first RPM package and the second RPM package and comparing them comprises: Determine a python file from the first RPM package and the second RPM package according to the file name suffix; The configuration information in the python file is taken out and stored in the file information tuples of the first RPM package and the second RPM package, and the two packages are compared.

3. The method according to claim 1, It is characterized in that The function parameters include mandatory parameters and optional parameters; When the number of function parameters in the file information tuple changes, dividing the compatibility level according to the change in the number of function parameters includes: When the number of the mandatory parameters in the file information tuple increases, the compatibility level of the first RPM package exceeds the preset level; When the sum of the number of the mandatory parameters and the number of the optional parameters in the file information tuple decreases, the compatibility level of the first RPM package exceeds the preset level.

4. The method according to claim 1, It is characterized in that The method further comprises: Show deleted function symbols; Shows the changed function parameters and the corresponding compatibility level.

5. The method according to claim 1, It is characterized in that The method further comprises: When a function symbol is newly added in the file information tuple, the newly added function symbol is displayed.

6. The method according to claim 1, It is characterized in that The method further comprises: In response to the trigger instruction, the step of obtaining the first RPM package to be checked is triggered according to the trigger instruction.

7. A compatibility analysis device, It is characterized in that include: An acquiring unit, used for acquiring a first RPM package to be checked; a matching unit, configured to match a second RPM package corresponding to the first RPM package, wherein a version of the second RPM package is lower than a version of the first RPM package; A comparison unit, configured to obtain and compare file information tuples of the first RPM package and the second RPM package; A determination unit is used to determine that the first RPM package is incompatible when a function symbol is deleted in the file information tuple; when the number of function parameters changes in the file information tuple, divide the compatibility level according to the change in the number of function parameters; when the compatibility level exceeds a preset level, determine that the first RPM package is incompatible.

8. A computer device, It is characterized in that include: memories, transceivers, processors, and bus systems; Wherein, the memory is used to store programs; The processor is used to execute the program in the memory, including executing the method according to any one of claims 1 to 6; The bus system is used to connect the memory and the processor so that the memory and the processor can communicate with each other.

9. A computer-readable storage medium comprising instructions, which, when executed on a computer, causes the computer to perform the method according to any one of claims 1 to 6.

10. A computer program product, It is characterized in that When the computer program product is executed on a computer, the computer performs the method according to any one of claims 1 to 6.